Skip to content

fix(release): regenerate package directory index - #400

Open
jbdevprimary wants to merge 2 commits into
mainfrom
fix/package-directory-index
Open

fix(release): regenerate package directory index#400
jbdevprimary wants to merge 2 commits into
mainfrom
fix/package-directory-index

Conversation

@jbdevprimary

Copy link
Copy Markdown
Contributor

Regenerates jbcom/pkgs deterministic directory.json in the same signed cask/Scoop manifest update, so the package PR's validation gate receives a complete atomic change.\n\nValidated locally: bash scripts/ci/test_publish_cli_manifests.sh; go test ./tests/releasecontrol; actionlint; git diff --check.

@jbdevprimary
jbdevprimary enabled auto-merge August 24, 2026 21:55
@coderabbitai

coderabbitai Bot commented Aug 24, 2026

Copy link
Copy Markdown

Warning

Review limit reached

Next included review available in 37 minutes.

View limit details

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Learn how review limits work.

Review configuration:

⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro Plus

Run ID: 3d0a002b-2ecf-445a-b555-e852af5e8fc0

📥 Commits

Reviewing files that changed from the base of the PR and between e48e2bf and 4398347.

📒 Files selected for processing (2)
  • packaging/publish-cli-manifests.sh
  • scripts/ci/test_publish_cli_manifests.sh

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.

@amazon-q-developer amazon-q-developer 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.

This PR adds directory index regeneration to ensure atomic package updates include the complete directory.json file. The implementation correctly adds the generation step and updates both the production script and test coverage.

Critical Issue: The directory generation step lacks error handling, which could cause silent failures if the node script encounters issues. This must be fixed before merge to prevent validation gate failures.


You can now have the agent implement changes and create commits directly on your pull request's source branch. Simply comment with /q followed by your request in natural language to ask the agent to make changes.

Comment on lines +119 to +122
(
cd "$WORK/pkgs"
node scripts/generate-directory.mjs
)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🛑 Crash Risk: The subshell executes node scripts/generate-directory.mjs without error handling. If the node script fails (missing dependencies, script errors, or missing scripts/generate-directory.mjs in the cloned repository), the failure will be silently ignored due to the subshell, and the build will continue with a stale or missing directory.json, causing the validation gate to fail.

Suggested change
(
cd "$WORK/pkgs"
node scripts/generate-directory.mjs
)
cd "$WORK/pkgs"
if ! node scripts/generate-directory.mjs; then
echo "publish-cli-manifests: failed to generate directory index" >&2
exit 1
fi

@chatgpt-codex-connector chatgpt-codex-connector 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.

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: c028573852

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

cp "$SCOOP_MANIFEST" "$WORK/pkgs/bucket/radioactive-ralph.json"
(
cd "$WORK/pkgs"
node scripts/generate-directory.mjs

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Do not run package-repo code with release credentials

When jbcom/pkgs main contains a compromised or malicious scripts/generate-directory.mjs, this executes mutable cross-repository code while PKGS_GH_TOKEN and RELEASE_GH_TOKEN are present in the environment and the token-bearing GIT_ASKPASS file is available. The inspected package-manifests job in .github/workflows/release.yml grants the release token contents: write, so that code can modify both the package repository and radioactive-ralph release contents; generate the index using trusted code from this repository, or otherwise isolate the generator from all credentials and credential files.

Useful? React with 👍 / 👎.

@sonarqubecloud

Copy link
Copy Markdown

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