chore(ci): assign closed items to sprints#3216
Conversation
Signed-off-by: Will Curran <wcurran@nvidia.com>
📝 WalkthroughWalkthroughThis PR introduces a complete GitHub Actions workflow that automatically assigns closed GitHub issues and pull requests to the appropriate ProjectV2 sprint iteration. The workflow supports event-driven triggering (on close), scheduled reconciliation runs, and manual dispatch with configurable lookback windows and dry-run mode. It includes comprehensive tests validating triggers, permissions, action versions, and shell safety. ChangesSprint Assignment Automation
Estimated code review effort🎯 4 (Complex) | ⏱️ ~45 minutes Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
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 @.github/workflows/assign-closed-items-to-sprint.yaml:
- Around line 377-409: Currently a failed add_to_project call is treated as
fatal even though another concurrent run may have added the item; change the
logic in the project-add path (around add_to_project, project_item_id,
project_item_json, content_id, content_type, content_number, PROJECT_NUMBER) so
it is idempotent: after add_to_project returns empty or an error, re-query the
projectItems for the content (reuse the jq selection that produced
project_item_json) and if the item now exists set project_item_id and continue
instead of exiting; only treat the error as fatal if the refetch still shows the
item missing. Optionally, add a note that the workflow can instead be serialized
with concurrency: but implement the refetch-and-continue behavior in the
add_to_project failure branch to avoid races.
🪄 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: Path: .coderabbit.yaml
Review profile: CHILL
Plan: Enterprise
Run ID: abfcd64d-82bf-4a8c-bacf-d32632d38b24
📒 Files selected for processing (2)
.github/workflows/assign-closed-items-to-sprint.yamltest/assign-closed-items-to-sprint-workflow.test.ts
| project_item_json="$(jq -c \ | ||
| --arg project "$project_id" \ | ||
| '.data.node.projectItems.nodes[]? | select(.project.id == $project)' \ | ||
| <<<"$content_json" | head -n 1)" | ||
|
|
||
| if [ -n "$project_item_json" ]; then | ||
| project_item_id="$(jq -r '.id // empty' <<<"$project_item_json")" | ||
| existing_sprint="$(jq -r \ | ||
| --arg field "$sprint_field_id" \ | ||
| --arg name "$SPRINT_FIELD_NAME" \ | ||
| '.fieldValues.nodes[]? | ||
| | select(.__typename == "ProjectV2ItemFieldIterationValue") | ||
| | select((.field.id // "") == $field or (.field.name // "") == $name) | ||
| | .iterationId // empty' \ | ||
| <<<"$project_item_json" | head -n 1)" | ||
|
|
||
| if [ -n "$existing_sprint" ]; then | ||
| echo "Skipping $content_type #$content_number; Sprint is already set." | ||
| skipped=$((skipped + 1)) | ||
| return | ||
| fi | ||
| elif [ "$DRY_RUN" = "true" ]; then | ||
| project_item_id="" | ||
| echo "::notice::Would add $content_type #$content_number to project $PROJECT_NUMBER." | ||
| would_add=$((would_add + 1)) | ||
| else | ||
| project_item_id="$(add_to_project "$content_id")" | ||
| if [ -z "$project_item_id" ]; then | ||
| echo "::error::Failed to add $content_type #$content_number to project $PROJECT_NUMBER." | ||
| exit 1 | ||
| fi | ||
| echo "Added $content_type #$content_number to project $PROJECT_NUMBER." | ||
| added=$((added + 1)) |
There was a problem hiding this comment.
Make the project-add path idempotent across overlapping runs.
This block does a stale read of projectItems and then treats any add failure on Line 405 as fatal. Because the workflow can run from close events, schedule, and manual dispatch, two runs can both see “missing”, one wins the add, and the other fails even though the item is already in the project. Please either serialize the workflow with concurrency: or refetch the item after an add failure and continue when it already exists.
Possible localized fix
elif [ "$DRY_RUN" = "true" ]; then
project_item_id=""
echo "::notice::Would add $content_type #$content_number to project $PROJECT_NUMBER."
would_add=$((would_add + 1))
else
- project_item_id="$(add_to_project "$content_id")"
+ if ! project_item_id="$(add_to_project "$content_id" 2>/dev/null)"; then
+ content_json="$(fetch_content "$content_id")"
+ project_item_json="$(jq -c \
+ --arg project "$project_id" \
+ '.data.node.projectItems.nodes[]? | select(.project.id == $project)' \
+ <<<"$content_json" | head -n 1)"
+ project_item_id="$(jq -r '.id // empty' <<<"$project_item_json")"
+ fi
if [ -z "$project_item_id" ]; then
echo "::error::Failed to add $content_type #$content_number to project $PROJECT_NUMBER."
exit 1
fi
echo "Added $content_type #$content_number to project $PROJECT_NUMBER."🤖 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/assign-closed-items-to-sprint.yaml around lines 377 - 409,
Currently a failed add_to_project call is treated as fatal even though another
concurrent run may have added the item; change the logic in the project-add path
(around add_to_project, project_item_id, project_item_json, content_id,
content_type, content_number, PROJECT_NUMBER) so it is idempotent: after
add_to_project returns empty or an error, re-query the projectItems for the
content (reuse the jq selection that produced project_item_json) and if the item
now exists set project_item_id and continue instead of exiting; only treat the
error as fatal if the refetch still shows the item missing. Optionally, add a
note that the workflow can instead be serialized with concurrency: but implement
the refetch-and-continue behavior in the add_to_project failure branch to avoid
races.
## Summary - Bump the docs release metadata to `0.0.38`. - Document release-prep updates for status policy versions, Local Ollama validation and cleanup, blueprint policy additions, rebuild backup handling, and NemoHermes uninstall branding. - Refresh generated `nemoclaw-user-*` skills from the updated docs. ## Source summary - #3185 -> `docs/reference/commands.md`: Documents that `nemoclaw <name> status` displays the gateway active policy version when OpenShell reports one. - #3167 -> `docs/reference/commands.md`, `docs/inference/use-local-inference.md`: Documents uninstall cleanup for matching Local Ollama auth proxy processes. - #2737 -> `docs/inference/use-local-inference.md`, `docs/network-policy/customize-network-policy.md`, `docs/manage-sandboxes/lifecycle.md`, `docs/reference/commands.md`: Documents stricter Local Ollama tool-call validation, blueprint policy additions, and partial rebuild backup handling. - #3220 -> `docs/reference/commands.md`: Documents NemoHermes-specific uninstall progress and completion text. - #3158 -> `.agents/skills/nemoclaw-user-configure-inference/*`: Refreshes generated user skills from existing `docs/inference/switch-inference-providers.md` heartbeat documentation. - #3199 -> `.agents/skills/nemoclaw-user-get-started/SKILL.md`: Refreshes generated user skills from existing `docs/get-started/quickstart.md` Model Router wording. ## Skipped - #3272 and #3268 were already documented by their merged docs updates on `main`. - #3154, #3216, #3166, and #3195 have no additional user-facing docs impact for this release-prep pass. - No commits matched `docs/.docs-skip`. ## Test plan - `python3 scripts/docs-to-skills.py docs/ .agents/skills/ --prefix nemoclaw-user` - `make docs` - `npm run build:cli` - Commit and pre-push hooks: markdownlint, docs-to-skills verification, gitleaks, commitlint, skills YAML tests, CLI typecheck Made with [Cursor](https://cursor.com) <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Behavior Changes** * Rebuild now safely handles partial backups, preserving successfully captured entries while reporting only unarchived paths * Uninstall for Local Ollama setups now stops proxy processes before cleanup * Local Ollama models require stricter tool-call response validation during onboarding * Blueprint policy additions enable custom network policy extensions via `components.policy.additions` * New `NEMOCLAW_AGENT_HEARTBEAT_EVERY` configuration controls agent periodic task frequency * Status display now shows active policy version when available <!-- end of auto-generated comment: release notes by coderabbit.ai --> Co-authored-by: Cursor <cursoragent@cursor.com>
## Summary Reverts the closed-item sprint assignment automation introduced in #3216. This removes the GitHub Actions workflow and its static workflow test so closed issues and pull requests are no longer assigned to sprint iterations automatically by this repository. ## Related Issue Reverts #3216. ## Changes - Removes `.github/workflows/assign-closed-items-to-sprint.yaml`. - Removes `test/assign-closed-items-to-sprint-workflow.test.ts`. - Leaves sprint/project assignment behavior to the existing manual or external process. ## Type of Change - [x] Code change (feature, bug fix, or refactor) - [ ] Code change with doc updates - [ ] Doc only (prose changes, no code sample modifications) - [ ] Doc only (includes code sample changes) ## Verification - [x] `npx prek run --all-files` passes - [x] `npm test` passes - [ ] Tests added or updated for new or changed behavior - [x] No secrets, API keys, or credentials committed - [ ] Docs updated for user-facing behavior changes - [ ] `make docs` builds without warnings (doc changes only) - [ ] Doc pages follow the [style guide](https://github.com/NVIDIA/NemoClaw/blob/main/docs/CONTRIBUTING.md) (doc changes only) - [ ] New doc pages include SPDX header and frontmatter (new pages only) --- <!-- DCO sign-off required by CI. Run: git config user.name && git config user.email --> Signed-off-by: Carlos Villela <cvillela@nvidia.com> <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Chores** * Removed GitHub Actions workflow automation and associated test suite. [](https://app.coderabbit.ai/change-stack/NVIDIA/NemoClaw/pull/3322) <!-- end of auto-generated comment: release notes by coderabbit.ai -->
Summary
Adds a metadata-only GitHub Actions workflow that assigns closed issues and pull requests to the NemoClaw Development Tracker Sprint field when they do not already have one. The workflow uses GitHub App authentication and direct ProjectV2 GraphQL mutations so closed work stays represented in sprint reporting.
Changes
.github/workflows/assign-closed-items-to-sprint.yamlfor closed issue/PR events, hourly reconciliation, and manual dry-run reconciliation.actions/create-github-app-tokenaction with organization project permissions instead ofactions/add-to-projector a PAT.Type of Change
Verification
npx prek run --all-filespassesnpm testpassesmake docsbuilds without warnings (doc changes only)Additional validation:
npx vitest run --project cli test/assign-closed-items-to-sprint-workflow.test.tspasses.npm run typecheck:clipasses.Sprint 4 - Spark Joyfor a closed PR missing Sprint.Sprint 4 - Spark Joy.Skipped/failed local checks:
npx prek run --all-filesstopped athadolintbecausehadolintis not installed in this environment; earlier hook steps passed through Biome lint fixes.npm testwas attempted after rebuilding root CLI and nested plugin artifacts, but still failed on unrelated local/environment-sensitive tests: plugin/package artifact setup, installer integration timeouts, and existing numeric env validation expectations.Signed-off-by: Will Curran wcurran@nvidia.com
Summary by CodeRabbit
New Features
Tests