Skip to content

chore: automate release train metadata sync#16

Merged
Arenukvern merged 1 commit into
mainfrom
codex/release-train-sync-automation
Jun 29, 2026
Merged

chore: automate release train metadata sync#16
Arenukvern merged 1 commit into
mainfrom
codex/release-train-sync-automation

Conversation

@Arenukvern

@Arenukvern Arenukvern commented Jun 29, 2026

Copy link
Copy Markdown
Owner

Summary

  • Add a dependency-free release train metadata checker/syncer for package versions, internal IntentCall floors, and native podspec versions.
  • Run the release train metadata check before dart pub get in CI so stale floors fail with a useful message instead of a solver error.
  • Add a Release Please PR sync workflow plus just/CLI commands for maintainers.

Validation

  • dart tool/intentcall/bin/release_train.dart check
  • dart run tool/intentcall/bin/intentcall.dart sync-release-train --check
  • dart test tool/intentcall/test/publish_preflight_test.dart
  • dart format --output=none --set-exit-if-changed .
  • just analyze
  • just test
  • just docs-check
  • dart run tool/intentcall/bin/intentcall.dart validate
  • steward probe --json --profile quick
  • steward benchmark --scenario intentcall.adapter-contract --json
  • just publish-dry-run

Summary by CodeRabbit

  • New Features

    • Added release-train maintenance commands to verify and sync package and platform version metadata.
    • Added a new automated workflow to keep release-train metadata up to date on relevant pull requests.
    • Added a CI check to validate release-train consistency during existing test runs.
  • Bug Fixes

    • Automated updates now keep package versions, dependency version floors, and platform version files aligned.

@docs-page

docs-page Bot commented Jun 29, 2026

Copy link
Copy Markdown

To preview the documentation for this pull request, visit the following URL:

docs.page/arenukvern/intentcall~16

Documentation is deployed and generated using docs.page

@coderabbitai

coderabbitai Bot commented Jun 29, 2026

Copy link
Copy Markdown

Review Change Stack

📝 Walkthrough

Walkthrough

Adds tool/intentcall/bin/release_train.dart, a new Dart script implementing check and sync commands for release-train metadata consistency across pubspec.yaml versions, internal dependency floor constraints, and iOS/macOS podspec versions. The script is wired into intentcall.dart as new CLI commands, enforced in CI, automated via a new GitHub Actions workflow for release-please PRs, and covered by new tests.

Changes

Release Train Metadata Sync

Layer / File(s) Summary
release_train.dart: packages, version resolution, check/sync logic, and helpers
tool/intentcall/bin/release_train.dart
New script defining publishable/internal package sets, repo-root discovery, version resolution from .release-please-manifest.json or pubspec consensus, check/sync control flow, regex-based rewriters for pubspec version, dependency floor constraints, and podspec s.version, plus I/O and arg-parsing utilities.
intentcall.dart: new commands wired to release_train
tool/intentcall/bin/intentcall.dart
Imports release_train.dart, registers check-release-train and sync-release-train in ArgParser with --version and --check flags, dispatches to runReleaseTrainCheck/runReleaseTrainSync, and updates printUsage.
Tests: fixture creation and check/sync assertions
tool/intentcall/test/publish_preflight_test.dart
Adds release train sync test group with pre-sync check, full sync, and checkOnly mode tests; adds _createReleaseTrainFixture and _writePubspec helpers.
CI enforcement, PR sync workflow, and justfile targets
.github/workflows/ci.yml, .github/workflows/release-pr-sync-train.yml, justfile
Adds CI step running release_train.dart check, a new workflow auto-syncing metadata on release-please PRs with commit-back, and three just targets for local use.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • Arenukvern/intentcall#3: Modifies the same intentcall.dart CLI entrypoint by extending ArgParser, the command dispatch switch, and usage output with new subcommands.
  • Arenukvern/intentcall#11: Bumps all intentcall package versions including pubspec.yaml, podspec s.version, and .release-please-manifest.json—exactly the metadata files this PR's sync tooling manages.

Poem

🐇 Hop hop, the train stays on track,
versions aligned, no going back.
Manifest checked, podspecs in line,
a CI step to keep things fine.
The rabbit nods — the metadata's right! ✅

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: automating release train metadata sync.
Description check ✅ Passed The description includes the required Summary and Validation sections and covers the core changes, but it omits the template's Scope and governance details.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
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.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/release-train-sync-automation

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.

@Arenukvern Arenukvern merged commit 55784aa into main Jun 29, 2026
2 of 3 checks passed
@Arenukvern Arenukvern deleted the codex/release-train-sync-automation branch June 29, 2026 13:40

@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

🧹 Nitpick comments (2)
tool/intentcall/test/publish_preflight_test.dart (2)

339-394: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Build the fixture from allInternalPackages, not a hand-maintained subset.

syncReleaseTrainMetadata() rewrites floors for every entry in allInternalPackages, but this fixture only materializes publishablePackages plus intentcall_gemma. If another internal-only package is added, these tests will fail for setup reasons instead of sync behavior.

Possible follow-up
+  final publishable = release_train.publishablePackages.toSet();
-  for (final packageName in release_train.publishablePackages) {
+  for (final packageName in release_train.allInternalPackages) {
     final deps = switch (packageName) {
       ...
+      'intentcall_gemma' =>
+        '  intentcall_core: ^0.5.0\n'
+        '  intentcall_schema: ^0.5.0\n'
+        '  intentcall_testing: ^0.5.0\n',
       _ => '',
     };
-    _writePubspec(repo, packageName, version: '0.6.0', dependencies: deps);
+    _writePubspec(
+      repo,
+      packageName,
+      version: '0.6.0',
+      dependencies: deps,
+      publishToNone: !publishable.contains(packageName),
+    );
   }
-
-  _writePubspec(... 'intentcall_gemma' ...)
🤖 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 `@tool/intentcall/test/publish_preflight_test.dart` around lines 339 - 394, The
release-train fixture in _createReleaseTrainFixture is only creating
publishablePackages plus intentcall_gemma, but syncReleaseTrainMetadata()
operates over allInternalPackages. Update the fixture setup to materialize every
package from allInternalPackages (including internal-only ones) so the test
coverage stays aligned with the metadata sync logic and won’t break when new
internal packages are added.

194-229: 📐 Maintainability & Code Quality | 🔵 Trivial | ⚡ Quick win

Exercise the publishable version: rewrite too.

This test proves floor and podspec updates, but it never makes a publishable package version stale, so the first syncReleaseTrainMetadata() loop is untested. Seed one publishable pubspec.yaml at 0.5.0 and assert it becomes 0.6.0 after sync.

Possible follow-up
-    _writePubspec(repo, packageName, version: '0.6.0', dependencies: deps);
+    _writePubspec(
+      repo,
+      packageName,
+      version: packageName == 'intentcall_core' ? '0.5.0' : '0.6.0',
+      dependencies: deps,
+    );
       expect(syncCode, 0);
       expect(await release_train.runReleaseTrainCheck(repo), 0);
+      expect(
+        File(
+          p.join(repo.path, 'packages', 'intentcall_core', 'pubspec.yaml'),
+        ).readAsStringSync(),
+        contains('version: 0.6.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 `@tool/intentcall/test/publish_preflight_test.dart` around lines 194 - 229, The
release train sync test only covers dependency floor and podspec updates, so it
misses the publishable version rewrite path in syncReleaseTrainMetadata().
Update the fixture setup in publish_preflight_test.dart to make one publishable
package pubspec.yaml stale at 0.5.0, then extend the assertions after
runReleaseTrainSync(repo) to verify that the version is rewritten to 0.6.0,
using the existing release_train.runReleaseTrainSync and runReleaseTrainCheck
flow.
🤖 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 @.github/workflows/release-pr-sync-train.yml:
- Around line 12-14: The workflow permissions are broader than needed because
the release PR sync job only pushes commits back to the branch, so the
`pull-requests: write` scope should be removed. Update the permissions block in
the release sync workflow to keep only the `contents: write` access, and leave
the rest of the job unchanged.

In `@justfile`:
- Around line 53-58: The sync-release-train targets still invoke the intentcall
entrypoint through dart run, which can depend on stale pub resolution; update
both sync-release-train and sync-release-train-version in the justfile to call
the dedicated release_train.dart sync script directly with dart
tool/intentcall/bin/release_train.dart sync, preserving the version argument for
the versioned target.

---

Nitpick comments:
In `@tool/intentcall/test/publish_preflight_test.dart`:
- Around line 339-394: The release-train fixture in _createReleaseTrainFixture
is only creating publishablePackages plus intentcall_gemma, but
syncReleaseTrainMetadata() operates over allInternalPackages. Update the fixture
setup to materialize every package from allInternalPackages (including
internal-only ones) so the test coverage stays aligned with the metadata sync
logic and won’t break when new internal packages are added.
- Around line 194-229: The release train sync test only covers dependency floor
and podspec updates, so it misses the publishable version rewrite path in
syncReleaseTrainMetadata(). Update the fixture setup in
publish_preflight_test.dart to make one publishable package pubspec.yaml stale
at 0.5.0, then extend the assertions after runReleaseTrainSync(repo) to verify
that the version is rewritten to 0.6.0, using the existing
release_train.runReleaseTrainSync and runReleaseTrainCheck flow.
🪄 Autofix (Beta)

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: defaults

Review profile: CHILL

Plan: Pro

Run ID: 7a008adf-83ac-4192-b885-efcbfc7b6da4

📥 Commits

Reviewing files that changed from the base of the PR and between 7e71715 and 3434a3b.

📒 Files selected for processing (6)
  • .github/workflows/ci.yml
  • .github/workflows/release-pr-sync-train.yml
  • justfile
  • tool/intentcall/bin/intentcall.dart
  • tool/intentcall/bin/release_train.dart
  • tool/intentcall/test/publish_preflight_test.dart

Comment on lines +12 to +14
permissions:
contents: write
pull-requests: write

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🔒 Security & Privacy | 🟠 Major | ⚡ Quick win

Drop the unused pull-requests: write permission.

This job only needs to push commits back to the branch. Keeping PR-write scope here unnecessarily broadens the token if the workflow is ever repurposed or a later step is added.

Suggested fix
 permissions:
   contents: write
-  pull-requests: write
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
permissions:
contents: write
pull-requests: write
permissions:
contents: write
🤖 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 @.github/workflows/release-pr-sync-train.yml around lines 12 - 14, The
workflow permissions are broader than needed because the release PR sync job
only pushes commits back to the branch, so the `pull-requests: write` scope
should be removed. Update the permissions block in the release sync workflow to
keep only the `contents: write` access, and leave the rest of the job unchanged.

Comment thread justfile
Comment on lines +53 to +58
sync-release-train:
dart run tool/intentcall/bin/intentcall.dart sync-release-train

# Synchronize release train metadata to a specific version
sync-release-train-version version:
dart run tool/intentcall/bin/intentcall.dart sync-release-train --version {{version}}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
set -euo pipefail

printf '## justfile targets\n'
git ls-files justfile
echo

echo '## relevant justfile excerpt'
nl -ba justfile | sed -n '45,70p'
echo

echo '## tool/intentcall/bin files'
git ls-files 'tool/intentcall/bin/*'
echo

echo '## search for release_train and sync-release-train references'
rg -n "release_train|sync-release-train|intentcall" justfile tool/intentcall/bin -g '!**/node_modules/**'
echo

echo '## outline release_train.dart if present'
if [ -f tool/intentcall/bin/release_train.dart ]; then
  ast-grep outline tool/intentcall/bin/release_train.dart --view expanded || true
fi

Repository: Arenukvern/intentcall

Length of output: 258


🏁 Script executed:

#!/bin/bash
set -euo pipefail

echo '## justfile excerpt'
sed -n '45,70p' justfile
echo

echo '## intentcall bin files'
git ls-files 'tool/intentcall/bin/*'
echo

echo '## release_train and sync references'
rg -n "release_train|sync-release-train|intentcall" justfile tool/intentcall/bin
echo

echo '## if release_train.dart exists, show its first 220 lines'
if [ -f tool/intentcall/bin/release_train.dart ]; then
  sed -n '1,220p' tool/intentcall/bin/release_train.dart
fi

Repository: Arenukvern/intentcall

Length of output: 15712


Keep the sync targets dependency-free. sync-release-train and sync-release-train-version still go through dart run, so they can fail in the same stale pub-resolution state they're meant to fix. Point them at dart tool/intentcall/bin/release_train.dart sync instead.

🤖 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 `@justfile` around lines 53 - 58, The sync-release-train targets still invoke
the intentcall entrypoint through dart run, which can depend on stale pub
resolution; update both sync-release-train and sync-release-train-version in the
justfile to call the dedicated release_train.dart sync script directly with dart
tool/intentcall/bin/release_train.dart sync, preserving the version argument for
the versioned target.

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.

1 participant