Skip to content

Conversation

@cmeesters
Copy link
Member

@cmeesters cmeesters commented Oct 14, 2025

This PR merely adds another directory to deploy when deploying profiles. Yes, this is a non-standard approach, but snakedeploy will silently ignore this. I recommend doing so to avoid dissappointment from users.

Summary by CodeRabbit

  • New Features

    • More flexible profile discovery: searches root-level profiles first, then falls back to workflow profiles if needed.
    • Clearer logging: shows the exact source path of the selected profiles and adds an informational note encouraging contributions of adapted profiles.
  • Refactor

    • Reformatted assertions for readability without changing behavior.
  • Style

    • Minor formatting updates to configuration mappings and assertions; no functional impact.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 14, 2025

📝 Walkthrough

Walkthrough

Updates adjust deploy_profile to search profiles in two locations with added logging; other changes reformat assertions and dictionary key spacing without altering behavior.

Changes

Cohort / File(s) Summary
Deploy profile lookup and logging
snakedeploy/deploy.py
deploy_profile now checks profiles/ at repo root, then falls back to workflow/profiles/; logs the resolved source path and an extra info message; copy/warn behavior unchanged.
Assertion formatting
snakedeploy/conda.py, versioneer.py
Reformatted multi-line assertions into single-line parenthesized form; no logic changes.
Versioneer mapping formatting
versioneer.py
Reformatted LONG_VERSION_PY assignment for the "git" key to a spaced, multi-line index style; no semantic changes.

Sequence Diagram(s)

sequenceDiagram
  autonumber
  actor User
  participant Deploy as deploy_profile
  participant FS as Filesystem

  User->>Deploy: invoke deploy_profile(...)
  Deploy->>FS: check repo_root/profiles/
  alt profiles found at root
    Deploy->>FS: copy profiles to target (dirs_exist_ok=force)
    Deploy-->>User: log source path + contribution info
  else profiles not at root
    Deploy->>FS: check workflow/profiles/
    alt profiles found in workflow
      Deploy->>FS: copy profiles to target (dirs_exist_ok=force)
      Deploy-->>User: log source path + contribution info
    else not found anywhere
      Deploy-->>User: warn: no profiles directory found
    end
  end
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested reviewers

  • johanneskoester

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 75.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title clearly highlights the key feature change, namely that profile deployment now includes additional non-standard directory paths, and it succinctly captures the intent of the commit without extraneous details. It is specific to the deploy profiles functionality and aligns well with the pull request’s objectives.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feat/profiles

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 0

🧹 Nitpick comments (1)
snakedeploy/deploy.py (1)

91-97: Consider clarifying which locations were checked in the warning.

When no profile directory is found at either location, the warning message doesn't specify which paths were checked. This could leave users uncertain about where to place their profiles.

Apply this diff to improve clarity:

     no_profile = not profile_dir.exists()
     if no_profile:
         logger.warning(
-            "No profile directory found in source repository. "
+            "No profile directory found in source repository "
+            "(checked 'profiles' and 'workflow/profiles'). "
             "Please check whether the source repository really does not "
             "need or provide any profiles."
         )
📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between d98dffd and 51f40be.

⛔ Files ignored due to path filters (1)
  • pyproject.toml is excluded by !pyproject.toml
📒 Files selected for processing (3)
  • snakedeploy/conda.py (1 hunks)
  • snakedeploy/deploy.py (2 hunks)
  • versioneer.py (2 hunks)
🧰 Additional context used
📓 Path-based instructions (1)
**/*.py

⚙️ CodeRabbit configuration file

**/*.py: Do not try to improve formatting.
Do not suggest type annotations for functions that are defined inside of functions or methods.
Do not suggest type annotation of the self argument of methods.
Do not suggest type annotation of the cls argument of classmethods.
Do not suggest return type annotation if a function or method does not contain a return statement.

Files:

  • snakedeploy/deploy.py
  • versioneer.py
  • snakedeploy/conda.py
🧬 Code graph analysis (1)
snakedeploy/deploy.py (1)
snakedeploy/logger.py (1)
  • info (104-105)
🔇 Additional comments (5)
snakedeploy/conda.py (1)

130-132: LGTM!

The assertion logic is unchanged; this is a pure formatting refactor.

snakedeploy/deploy.py (2)

84-90: LGTM!

The two-step profile directory lookup (root first, then workflow subdirectory) correctly implements the feature described in the PR objectives. The fallback mechanism is sound and the code silently handles the non-standard directory as intended.


99-106: LGTM!

The informative logging about the source path and the encouragement to contribute adapted profiles back to the original repository are valuable additions for users.

versioneer.py (2)

420-422: LGTM!

The dictionary key assignment formatting is changed without altering behavior.


1459-1461: LGTM!

The assertion logic is unchanged; this is a pure formatting refactor.

Copy link
Contributor

@johanneskoester johanneskoester left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mhm. Snakedeploy is designed to reward sticking to the standards. I am hesitant to break with that rule.

@cmeesters
Copy link
Member Author

Yes, I understand that. It was an attempt. I first overlooked that the feature has already been merged. And then felt, it is probably worth contemplating. Got ahead of myself.

@cmeesters cmeesters closed this Oct 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants