Skip to content

feat(devtools): bump Flow canary on release - #6830

Merged
lorenzejay merged 9 commits into
mainfrom
lorenze/imp/canary-flow-deployment-e2e-tests
Aug 5, 2026
Merged

feat(devtools): bump Flow canary on release#6830
lorenzejay merged 9 commits into
mainfrom
lorenze/imp/canary-flow-deployment-e2e-tests

Conversation

@lorenzejay

@lorenzejay lorenzejay commented Aug 5, 2026

Copy link
Copy Markdown
Collaborator

What

  • Generalize deployment canary updates across both crewAIInc/crew_deployment_test and crewAIInc/flow_deployment_test
  • Update and merge each canary's exact CrewAI version sequentially before starting the enterprise release
  • Document the expanded release sequence and add behavior coverage for both repositories

Why

The Flow release-validation deployment could remain pinned to an older CrewAI version even after a new OSS release was published. That made the enterprise E2E job compare the incoming release against a stale Flow deployment.

Impact

Both persistent canary sources will now be version-aligned with the OSS release before the enterprise release workflow redeploys and validates them.

Validation

  • uv run pytest lib/devtools/tests (39 passed)
  • uv run ruff check lib/devtools/src/crewai_devtools/cli.py lib/devtools/tests/test_toml_updates.py
  • uv run ruff format --check lib/devtools/src/crewai_devtools/cli.py lib/devtools/tests/test_toml_updates.py

Note

Medium Risk
Touches the end-to-end release pipeline and external canary repos; mistakes could block releases or leave canaries misaligned, but there is no auth or production runtime code change.

Overview
Release automation now bumps both crewAIInc/crew_deployment_test and crewAIInc/flow_deployment_test to the exact OSS CrewAI version (PR + merge wait) before the enterprise release phase, so Flow validation deployments are not left on an older pin.

The single-repo helper is generalized via _update_deployment_test_repos, with post-bump validation that every effective crewai requirement in pyproject.toml and real install commands in workflow run steps (parsed with PyYAML + shlex) uses == on the target version. Mismatches or missing pins fail the step with clearer resume hints.

README release steps and devtools tests cover the dual-canary flow and validation edge cases (quoted installs, multiline runs, non-exact pins, echo/comments).

Reviewed by Cursor Bugbot for commit bb1b32f. Bugbot is set up for automated code reviews on this repo. Configure here.

@coderabbitai

coderabbitai Bot commented Aug 5, 2026

Copy link
Copy Markdown

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

The release CLI now validates exact CrewAI pins and updates both Crew and Flow deployment test repositories during prerelease releases. The release documentation reflects the new order, and tests cover repository updates and pin validation.

Changes

Deployment release automation

Layer / File(s) Summary
Deployment repository validation
lib/devtools/src/crewai_devtools/cli.py, lib/devtools/tests/test_toml_updates.py, lib/devtools/pyproject.toml
The CLI validates CrewAI pins in pyproject.toml and workflow commands. Tests cover missing, mixed, commented, echoed, spaced, environment-marked, and multiline cases. The project adds the YAML parser dependency.
Deployment repository update logic
lib/devtools/src/crewai_devtools/cli.py, lib/devtools/tests/test_toml_updates.py
The CLI manages Crew and Flow deployment test repositories with repository-specific paths and messages. Tests verify sequential updates for both repositories.
Release orchestration and documentation
lib/devtools/src/crewai_devtools/cli.py, lib/devtools/README.md
The release flow updates all deployment canaries and reports both repositories in failure guidance. The documentation reflects the revised release order and command spacing.

Sequence Diagram(s)

sequenceDiagram
  participant ReleaseWorkflow
  participant DeploymentUpdater
  participant CanaryRepository
  participant RepositoryFiles
  ReleaseWorkflow->>DeploymentUpdater: update all deployment canaries
  DeploymentUpdater->>CanaryRepository: clone repository
  CanaryRepository->>RepositoryFiles: inspect project and workflow dependencies
  RepositoryFiles-->>DeploymentUpdater: return CrewAI requirements
  DeploymentUpdater->>DeploymentUpdater: validate exact release pin
  DeploymentUpdater->>CanaryRepository: update version and create PR
  CanaryRepository-->>ReleaseWorkflow: return repository-specific result
Loading
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 47.62% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description check ✅ Passed The description accurately explains the dual-canary release updates, validation changes, documentation, tests, and motivation.
Title check ✅ Passed The title clearly describes the canary release update and directly relates to the main deployment tooling changes.
✨ Finishing Touches 💡 2
📝 Generate docstrings 💡
  • Create stacked PR
  • Commit on current branch
🛠️ Fix failing CI checks 💡
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch lorenze/imp/canary-flow-deployment-e2e-tests

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.

@github-actions github-actions Bot added the size/S label Aug 5, 2026
@lorenzejay
lorenzejay marked this pull request as ready for review August 5, 2026 18:49
@lorenzejay
lorenzejay enabled auto-merge (squash) August 5, 2026 18:50

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@lib/devtools/src/crewai_devtools/cli.py`:
- Around line 1461-1469: Update _update_deployment_test_repo to validate that
pyproject.toml or the deployment workflows contain an exact crewai==<version>
pin after _pin_crewai_deps runs. If no expected pin is found, replace the
current warning-only else path with a failure that prevents successful
completion; preserve the existing write and success message when the pin is
updated.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 81dbb194-ac82-4579-9fa4-94fa2334be18

📥 Commits

Reviewing files that changed from the base of the PR and between 8320178 and 8d506d5.

📒 Files selected for processing (3)
  • lib/devtools/README.md
  • lib/devtools/src/crewai_devtools/cli.py
  • lib/devtools/tests/test_toml_updates.py

Comment thread lib/devtools/src/crewai_devtools/cli.py
@github-actions github-actions Bot added size/M and removed size/S labels Aug 5, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@lib/devtools/src/crewai_devtools/cli.py`:
- Around line 1441-1468: Update _validate_deployment_repo_crewai_pin and its
matching helper to inspect parsed pyproject.toml dependency fields and
executable workflow installation commands rather than arbitrary raw text.
Collect every effective CrewAI pin, reject any pin differing from version, and
require at least one valid pin; do not treat comments or unrelated commands such
as echo as effective dependencies. Add regression coverage for mixed old/new
pins and comment-only matches.

In `@lib/devtools/tests/test_toml_updates.py`:
- Around line 38-43: Summary: CrewAI pin validation must ignore comments and
unrelated text and verify active dependency or workflow entries. Add a
regression test in test_exact_crewai_pin_accepts_plain_and_extra_dependencies
(or nearby) covering a commented exact pin alongside an invalid active
requirement. Update _validate_deployment_repo_crewai_pin and its validation
helpers to parse actual TOML dependency entries and workflow run commands,
rather than accepting matches from raw content, while preserving support for
plain and extras-qualified exact pins.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: f3131eff-107f-4d55-9940-26daa817075b

📥 Commits

Reviewing files that changed from the base of the PR and between 8d506d5 and 6e81e64.

📒 Files selected for processing (2)
  • lib/devtools/src/crewai_devtools/cli.py
  • lib/devtools/tests/test_toml_updates.py

Comment thread lib/devtools/src/crewai_devtools/cli.py Outdated
Comment thread lib/devtools/tests/test_toml_updates.py Outdated
Comment thread lib/devtools/src/crewai_devtools/cli.py Outdated
@github-actions github-actions Bot added size/L and removed size/M labels Aug 5, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (4)
lib/devtools/tests/test_toml_updates.py (1)

71-86: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Isolate the ignore behavior so the test can fail.

The pyproject dependency crewai>=1.0 already produces a mismatch. That mismatch alone satisfies the must all pin 2.0.0 assertion. If _workflow_crewai_requirements started to accept echo "crewai==2.0.0", or if the commented run: line started to count, this test would still pass. The intended behavior is therefore not covered.

Assert the ignore behavior without a competing mismatch: use a pyproject that declares no CrewAI dependency, then require the "No effective CrewAI dependency" error.

💚 Proposed test split
 def test_deployment_repo_validation_ignores_comments_and_echo(tmp_path: Path) -> None:
     workflows = tmp_path / ".github" / "workflows"
     workflows.mkdir(parents=True)
     (workflows / "test.yml").write_text(
         'run: echo "crewai==2.0.0"\n# run: pip install crewai==2.0.0\n'
     )
 
-    with pytest.raises(RuntimeError, match=r"must all pin 2\.0\.0"):
+    with pytest.raises(RuntimeError, match="No effective CrewAI dependency"):
         _validate_deployment_repo_crewai_pin(
             tmp_path,
-            (
-                "# documented pin: crewai==2.0.0\n"
-                '[project]\ndependencies = ["crewai>=1.0"]\n'
-            ),
+            '[project]\ndependencies = ["requests>=2"]\n',
             "2.0.0",
         )
+
+
+def test_deployment_repo_validation_ignores_pyproject_comment_pin(
+    tmp_path: Path,
+) -> None:
+    with pytest.raises(RuntimeError, match=r"must all pin 2\.0\.0"):
+        _validate_deployment_repo_crewai_pin(
+            tmp_path,
+            (
+                "# documented pin: crewai==2.0.0\n"
+                '[project]\ndependencies = ["crewai>=1.0"]\n'
+            ),
+            "2.0.0",
+        )
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@lib/devtools/tests/test_toml_updates.py` around lines 71 - 86, Update
test_deployment_repo_validation_ignores_comments_and_echo so the pyproject input
declares no CrewAI dependency, removing the competing version mismatch. Expect
the "No effective CrewAI dependency" RuntimeError instead, while retaining the
workflow content containing the echoed and commented CrewAI requirements to
directly verify _workflow_crewai_requirements ignores both.

Source: Coding guidelines

lib/devtools/src/crewai_devtools/cli.py (3)

1528-1552: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Extract the install-command prefixes into a module constant.

The command_lengths tuple rebuilds four token slices for every token position, and all four comparisons run before next() selects one. A module-level table of prefixes makes the supported installers explicit and removes the per-token slice construction.

♻️ Proposed refactor
+_INSTALL_COMMAND_PREFIXES: Final[tuple[tuple[str, ...], ...]] = (
+    ("python", "-m", "pip", "install"),
+    ("python3", "-m", "pip", "install"),
+    ("uv", "pip", "install"),
+    ("uv", "add"),
+    ("pip", "install"),
+    ("pip3", "install"),
+)
-            command_lengths = (
-                (tokens[index : index + 3] == ["uv", "pip", "install"], 3),
-                (tokens[index : index + 2] == ["uv", "add"], 2),
-                (
-                    tokens[index : index + 2]
-                    in (["pip", "install"], ["pip3", "install"]),
-                    2,
-                ),
-                (
-                    tokens[index : index + 4]
-                    in (
-                        ["python", "-m", "pip", "install"],
-                        ["python3", "-m", "pip", "install"],
-                    ),
-                    4,
-                ),
-            )
-            install_length = next(
-                (length for matched, length in command_lengths if matched),
-                0,
-            )
+            install_length = next(
+                (
+                    len(prefix)
+                    for prefix in _INSTALL_COMMAND_PREFIXES
+                    if tuple(tokens[index : index + len(prefix)]) == prefix
+                ),
+                0,
+            )
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@lib/devtools/src/crewai_devtools/cli.py` around lines 1528 - 1552, Extract
the four supported install-command token prefixes and their lengths into a
module-level constant, then update the loop around the install-command scanning
logic to iterate over that table instead of rebuilding command_lengths and token
slices at every index. Preserve the existing precedence and install_length
behavior for uv, pip/pip3, and python/python3 invocations.

1450-1457: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Document the three return states.

_crewai_requirement_pin returns None, "", or a version string. The docstring omits the None case. Callers use pin is not None to decide whether the string is a CrewAI requirement, so the distinction is important.

♻️ Proposed docstring update
 def _crewai_requirement_pin(requirement: str) -> str | None:
-    """Return an exact CrewAI pin, or an empty string for a non-exact pin."""
+    """Return the pinned CrewAI version for a requirement string.
+
+    Args:
+        requirement: A single requirement specifier.
+
+    Returns:
+        ``None`` when the requirement does not name CrewAI, ``""`` when the
+        requirement names CrewAI without an exact ``==`` pin, otherwise the
+        pinned version string.
+    """
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@lib/devtools/src/crewai_devtools/cli.py` around lines 1450 - 1457, Update the
_crewai_requirement_pin docstring to explicitly document all three return
states: None for non-CrewAI requirements, an empty string for CrewAI
requirements without an exact == pin, and the version string for exact pins.
Preserve the existing return behavior and caller-facing distinction.

Source: Coding guidelines


1478-1511: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚖️ Poor tradeoff

Use a YAML parser before extracting workflow run commands.

_workflow_run_commands treats raw lines as YAML. A map key indented deeper than a - run: | line is captured as part of the command, which can introduce false mismatches. Use a YAML reader and normalize jobs.*.steps[*].run values. PyYAML is not currently a crewai-devtools dependency, so add it only if this parsing is desired.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@lib/devtools/src/crewai_devtools/cli.py` around lines 1478 - 1511, Update
_workflow_run_commands to parse content with a YAML reader before extracting
commands, traversing jobs.*.steps[*].run values and normalizing scalar and block
values into strings. Add PyYAML as a crewai-devtools dependency if required by
the chosen parser, and remove the raw line-based extraction so nested mapping
keys cannot become command text.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@lib/devtools/src/crewai_devtools/cli.py`:
- Around line 1574-1576: Update the workflow iteration around
_workflow_crewai_requirements to process only regular files and read each file
with an explicit UTF-8 encoding. Preserve the existing .yml/.yaml filtering and
requirements extension behavior.

---

Nitpick comments:
In `@lib/devtools/src/crewai_devtools/cli.py`:
- Around line 1528-1552: Extract the four supported install-command token
prefixes and their lengths into a module-level constant, then update the loop
around the install-command scanning logic to iterate over that table instead of
rebuilding command_lengths and token slices at every index. Preserve the
existing precedence and install_length behavior for uv, pip/pip3, and
python/python3 invocations.
- Around line 1450-1457: Update the _crewai_requirement_pin docstring to
explicitly document all three return states: None for non-CrewAI requirements,
an empty string for CrewAI requirements without an exact == pin, and the version
string for exact pins. Preserve the existing return behavior and caller-facing
distinction.
- Around line 1478-1511: Update _workflow_run_commands to parse content with a
YAML reader before extracting commands, traversing jobs.*.steps[*].run values
and normalizing scalar and block values into strings. Add PyYAML as a
crewai-devtools dependency if required by the chosen parser, and remove the raw
line-based extraction so nested mapping keys cannot become command text.

In `@lib/devtools/tests/test_toml_updates.py`:
- Around line 71-86: Update
test_deployment_repo_validation_ignores_comments_and_echo so the pyproject input
declares no CrewAI dependency, removing the competing version mismatch. Expect
the "No effective CrewAI dependency" RuntimeError instead, while retaining the
workflow content containing the echoed and commented CrewAI requirements to
directly verify _workflow_crewai_requirements ignores both.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: cdbf8665-0356-4688-a046-642c30857e93

📥 Commits

Reviewing files that changed from the base of the PR and between 6e81e64 and 5e7a18e.

📒 Files selected for processing (2)
  • lib/devtools/src/crewai_devtools/cli.py
  • lib/devtools/tests/test_toml_updates.py

Comment thread lib/devtools/src/crewai_devtools/cli.py Outdated
Comment thread lib/devtools/src/crewai_devtools/cli.py
Comment thread lib/devtools/src/crewai_devtools/cli.py Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 1

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (1)
lib/devtools/src/crewai_devtools/cli.py (1)

1630-1636: 🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Make workflow pin updates accept plain crewai== requirements.

_update_workflow_crewai_pins only looks for crewai[...== patterns, while _validate_deployment_repo_crewai_pin accepts plain exact requirements such as uv pip install "crewai==2.0.0". A workflow with a stale bare pin would be accepted by the validation grammar but not updated, causing the release to fail on the next validation pass. Update _repin_crewai_install so it can rewrite plain crewai exact pins while preserving extras and non-exact requirements.

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@lib/devtools/src/crewai_devtools/cli.py` around lines 1630 - 1636, Update
_repin_crewai_install, used by _update_repo_workflows_crewai_pins, to recognize
and rewrite bare exact crewai== requirements in addition to crewai requirements
with extras. Preserve existing extra pins and leave non-exact requirements
unchanged, keeping the rewritten version consistent with the requested version.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@lib/devtools/src/crewai_devtools/cli.py`:
- Around line 1515-1522: Update _workflow_crewai_requirements to remove or
decode YAML scalar quoting from each workflow run command before passing it to
shlex, while preserving the embedded shell quoting needed to tokenize install
commands correctly. Add a regression test covering a quoted scalar run value
containing an exact crewai version pin, and verify the requirement is detected.

---

Outside diff comments:
In `@lib/devtools/src/crewai_devtools/cli.py`:
- Around line 1630-1636: Update _repin_crewai_install, used by
_update_repo_workflows_crewai_pins, to recognize and rewrite bare exact crewai==
requirements in addition to crewai requirements with extras. Preserve existing
extra pins and leave non-exact requirements unchanged, keeping the rewritten
version consistent with the requested version.
🪄 Autofix

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro Plus

Run ID: 7d526964-cc0d-446e-8095-c64614836808

📥 Commits

Reviewing files that changed from the base of the PR and between 5e7a18e and e054285.

📒 Files selected for processing (2)
  • lib/devtools/src/crewai_devtools/cli.py
  • lib/devtools/tests/test_toml_updates.py
🚧 Files skipped from review as they are similar to previous changes (1)
  • lib/devtools/tests/test_toml_updates.py

Comment thread lib/devtools/src/crewai_devtools/cli.py
Comment thread lib/devtools/src/crewai_devtools/cli.py
Comment thread lib/devtools/src/crewai_devtools/cli.py Outdated

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes using default effort and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit bb1b32f. Configure here.

Comment thread lib/devtools/src/crewai_devtools/cli.py
@lorenzejay
lorenzejay merged commit b1b6f6f into main Aug 5, 2026
62 of 93 checks passed
@lorenzejay
lorenzejay deleted the lorenze/imp/canary-flow-deployment-e2e-tests branch August 5, 2026 22:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants