-
Notifications
You must be signed in to change notification settings - Fork 0
ci: fix publish verification matrix #288
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+84
−5
Merged
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,74 @@ | ||
| import assert from 'node:assert/strict'; | ||
| import { readFileSync } from 'node:fs'; | ||
| import test from 'node:test'; | ||
|
|
||
| const publishWorkflow = readFileSync('.github/workflows/publish.yml', 'utf8'); | ||
| const verifyWorkflow = readFileSync('.github/workflows/verify-publish.yml', 'utf8'); | ||
|
miyaontherelay marked this conversation as resolved.
|
||
|
|
||
| function publishTargetDirectories(workflow) { | ||
| const match = workflow.match(/echo "packages=([^"]+)"/); | ||
| assert.ok(match, 'publish workflow must declare its package targets'); | ||
|
|
||
| return match[1].trim().split(/\s+/); | ||
| } | ||
|
|
||
| function publishPackageNames(workflow = publishWorkflow) { | ||
| return publishTargetDirectories(workflow).map((directory) => { | ||
| const packageJson = JSON.parse(readFileSync(`packages/${directory}/package.json`, 'utf8')); | ||
| return packageJson.name; | ||
| }); | ||
| } | ||
|
|
||
| function verifyPackageChoices(workflow = verifyWorkflow) { | ||
| const lines = workflow.replaceAll('\r\n', '\n').split('\n'); | ||
| const packageInput = lines.findIndex((line) => line === ' package:'); | ||
| assert.notEqual(packageInput, -1, 'verify workflow must declare the package input'); | ||
|
|
||
| const options = lines.findIndex( | ||
| (line, index) => index > packageInput && line === ' options:' | ||
| ); | ||
| assert.notEqual(options, -1, 'verify package input must declare choices'); | ||
|
miyaontherelay marked this conversation as resolved.
|
||
|
|
||
| const choices = []; | ||
| for (const line of lines.slice(options + 1)) { | ||
| const match = line.match(/^ - '([^']+)'$/); | ||
| if (!match) break; | ||
| choices.push(match[1]); | ||
| } | ||
| return choices; | ||
| } | ||
|
|
||
| test('Verify Publish exposes every lockstep package exactly once', () => { | ||
| const published = publishPackageNames(); | ||
| const verified = verifyPackageChoices(); | ||
|
miyaontherelay marked this conversation as resolved.
|
||
|
|
||
| assert.equal(new Set(published).size, published.length, 'publish targets must be unique'); | ||
| assert.equal(new Set(verified).size, verified.length, 'verify choices must be unique'); | ||
| assert.deepEqual(verified, published); | ||
| }); | ||
|
|
||
| test('release workflow parsing tolerates CRLF and target whitespace', () => { | ||
| assert.deepEqual(publishTargetDirectories('echo "packages= events persona-kit "'), [ | ||
| 'events', | ||
| 'persona-kit', | ||
| ]); | ||
| assert.deepEqual( | ||
| verifyPackageChoices(verifyWorkflow.replaceAll('\n', '\r\n')), | ||
| verifyPackageChoices() | ||
| ); | ||
| }); | ||
|
|
||
| test('scoped CLI verification checks only the supported thin-entry contract', () => { | ||
| const match = verifyWorkflow.match( | ||
| /- name: Scoped CLI package smoke test([\s\S]*?)\n - name: Library smoke test/ | ||
| ); | ||
| assert.ok(match, 'scoped CLI smoke step must exist'); | ||
|
|
||
| const step = match[1]; | ||
| assert.match(step, /assert\.equal\(pkg\.name, '@agentworkforce\/cli'\)/); | ||
| assert.match(step, /assert\.equal\(pkg\.version, '\$\{\{ steps\.resolve\.outputs\.version \}\}'\)/); | ||
| assert.match(step, /assert\.equal\(pkg\.bin, undefined\)/); | ||
| assert.match(step, /@agentworkforce\/cli\/dist\/cli\.js/); | ||
| assert.match(step, /assert\.equal\(typeof mod\.main, 'function'\)/); | ||
| assert.doesNotMatch(step, /CLI_VERSION|cli-impl/); | ||
| }); | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🎯 Functional Correctness | 🔴 Critical | ⚡ Quick win
Missing
@agentworkforce/eventsin the package options.The PR objective states that all 13 lockstep publish targets should be exposed, but the
optionslist only contains 12 items.@agentworkforce/eventsis missing. Sinceeventsis present as the first target in thepublish.ymlconfiguration, this omission will cause the newly addedrelease-workflows.test.mjstest to fail onassert.deepEqual(verified, published).🐛 Proposed fix
+ - '`@agentworkforce/events`' - '`@agentworkforce/persona-kit`' - '`@agentworkforce/runtime`' - '`@agentworkforce/compose`' - '`@agentworkforce/delivery`' - '`@agentworkforce/workload-router`' - '`@agentworkforce/deploy`' - '`@agentworkforce/review-kit`' - '`@agentworkforce/mcp-workforce`' - '`@agentworkforce/daytona-runner`' - '`@agentworkforce/local-surface`' - '`@agentworkforce/cli`' - 'agentworkforce'📝 Committable suggestion
🤖 Prompt for AI Agents