Skip to content

chore(ci): assign closed items to sprints#3216

Merged
cv merged 1 commit into
mainfrom
codex/assign-closed-items-to-sprint
May 8, 2026
Merged

chore(ci): assign closed items to sprints#3216
cv merged 1 commit into
mainfrom
codex/assign-closed-items-to-sprint

Conversation

@wscurran

@wscurran wscurran commented May 8, 2026

Copy link
Copy Markdown
Contributor

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

  • Adds .github/workflows/assign-closed-items-to-sprint.yaml for closed issue/PR events, hourly reconciliation, and manual dry-run reconciliation.
  • Uses a pinned actions/create-github-app-token action with organization project permissions instead of actions/add-to-project or a PAT.
  • Adds a static workflow test that checks triggers, permissions, no checkout, no title/body shell interpolation, and embedded shell syntax.

Type of Change

  • 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

  • npx prek run --all-files passes
  • npm test passes
  • Tests added or updated for new or changed behavior
  • 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 (doc changes only)
  • New doc pages include SPDX header and frontmatter (new pages only)

Additional validation:

  • npx vitest run --project cli test/assign-closed-items-to-sprint-workflow.test.ts passes.
  • npm run typecheck:cli passes.
  • Read-only dry run selected Sprint 4 - Spark Joy for a closed PR missing Sprint.
  • Read-only dry run reported it would add a closed PR missing from project 199 and assign Sprint 4 - Spark Joy.

Skipped/failed local checks:

  • npx prek run --all-files stopped at hadolint because hadolint is not installed in this environment; earlier hook steps passed through Biome lint fixes.
  • npm test was 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

    • Automated workflow assigns closed Issues and Pull Requests to Sprint iterations in ProjectV2
    • Manual dispatch with configurable lookback period and dry-run mode
    • Automatic triggers on item closure and scheduled intervals
  • Tests

    • Added test suite validating workflow configuration and safety constraints

Signed-off-by: Will Curran <wcurran@nvidia.com>
@wscurran wscurran added project management github_actions Pull requests that update GitHub Actions code labels May 8, 2026
@wscurran wscurran self-assigned this May 8, 2026
@copy-pr-bot

copy-pr-bot Bot commented May 8, 2026

Copy link
Copy Markdown

This pull request requires additional validation before any workflows can run on NVIDIA's runners.

Pull request vetters can view their responsibilities here.

Contributors can view more details about this message here.

@wscurran wscurran requested a review from cv May 8, 2026 00:10
@coderabbitai

coderabbitai Bot commented May 8, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

📝 Walkthrough

Walkthrough

This 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.

Changes

Sprint Assignment Automation

Layer / File(s) Summary
Workflow Metadata & Triggers
.github/workflows/assign-closed-items-to-sprint.yaml
Defines workflow triggers (closed issues/PRs, cron, manual dispatch), inputs (lookback_days, dry_run), permissions (contents:read), and GitHub App token generation.
Configuration & Discovery
.github/workflows/assign-closed-items-to-sprint.yaml
Validates input parameters, computes reconciliation cutoff timestamps, and resolves ProjectV2 ID, Sprint field metadata, and configured iterations via GraphQL.
Sprint Selection Algorithm
.github/workflows/assign-closed-items-to-sprint.yaml
Implements select_target_iteration logic that maps closed timestamps to active/prior/earliest sprint iteration windows based on configured boundaries.
Content Access & Mutations
.github/workflows/assign-closed-items-to-sprint.yaml
Provides fetch_content helper to retrieve Issue/PR details and ProjectV2 membership; implements add_to_project and set_sprint mutation helpers.
Per-Item Processing
.github/workflows/assign-closed-items-to-sprint.yaml
Main process_content function validates item type/repo/closed state, selects target sprint, detects duplicates, and performs mutations or dry-run reporting.
Reconciliation & Collection
.github/workflows/assign-closed-items-to-sprint.yaml
Implements collect_closed_ids to paginate closed items with optional lookback_days cutoff to support batch assignment runs.
Workflow Validation Tests
test/assign-closed-items-to-sprint-workflow.test.ts
Comprehensive test suite validating triggers, inputs, permissions, pinned action versions, absence of checkout, shell interpolation safety, and bash syntax correctness.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Poem

🐰 A sprinting workflow hops so true,
Closed issues sorted into queues,
GraphQL queries leap with grace,
Test guards keep dangers from this place!

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and specifically describes the main change: adding a GitHub Actions workflow to automatically assign closed items (issues and PRs) to sprint iterations in project management.
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.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch codex/assign-closed-items-to-sprint

Comment @coderabbitai help to get the list of available commands and usage tips.

@wscurran wscurran added the CI/CD label May 8, 2026

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown
Contributor

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 @.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

📥 Commits

Reviewing files that changed from the base of the PR and between a4a9eb0 and cbf6445.

📒 Files selected for processing (2)
  • .github/workflows/assign-closed-items-to-sprint.yaml
  • test/assign-closed-items-to-sprint-workflow.test.ts

Comment on lines +377 to +409
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))

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

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.

@wscurran wscurran enabled auto-merge (squash) May 8, 2026 00:27
@cv cv added v0.0.38 and removed v0.0.37 labels May 8, 2026
@cv cv merged commit 16947f2 into main May 8, 2026
15 checks passed
miyoungc added a commit that referenced this pull request May 9, 2026
## 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>
ericksoa pushed a commit that referenced this pull request May 10, 2026
## 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.

[![Review Change
Stack](https://storage.googleapis.com/coderabbit_public_assets/review-stack-in-coderabbit-ui.svg)](https://app.coderabbit.ai/change-stack/NVIDIA/NemoClaw/pull/3322)

<!-- end of auto-generated comment: release notes by coderabbit.ai -->
@wscurran wscurran added area: ci CI workflows, checks, release automation, or GitHub Actions chore Build, CI, dependency, or tooling maintenance area: project-management Taxonomy, triage, workflow, roadmap, or project process and removed CI/CD github_actions Pull requests that update GitHub Actions code labels Jun 3, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area: ci CI workflows, checks, release automation, or GitHub Actions area: project-management Taxonomy, triage, workflow, roadmap, or project process chore Build, CI, dependency, or tooling maintenance

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants