Skip to content

fix(ci): publish resilience + deps:tree fix + GitNexus license correction#36

Merged
carlos-alm merged 4 commits intomainfrom
fix/combined-pending-changes
Feb 23, 2026
Merged

fix(ci): publish resilience + deps:tree fix + GitNexus license correction#36
carlos-alm merged 4 commits intomainfrom
fix/combined-pending-changes

Conversation

@carlos-alm
Copy link
Contributor

Summary

Combines all pending unmerged work from stale branches into one PR.

  • fix(ci): move deps:tree to scripts/gen-deps.cjs — the inline node -e had backticks that sh on Linux interpreted as command substitution (sh: 1: n+t+: not found), and npm ls non-zero exit on ELSPROBLEMS threw in execSync. New script handles both with try/catch.
  • fix(ci): make publish idempotent on re-runs — add npm view checks before each platform package publish (skip if already on npm), and gate both publish steps on a check-main output so re-running a partially failed publish doesn't 409.
  • fix(ci): validate version input in workflow_dispatch — prevent empty or malformed version overrides.
  • docs: fix GitNexus license to PolyForm NC — was incorrectly listed as MIT. Add "Commercial use allowed" row to README feature comparison table.

Branches superseded by this PR

Test plan

  • Merge and re-trigger 2.1.0 stable publish via workflow_dispatch
  • Verify native packages are skipped ("already published — skipping")
  • Verify main @optave/codegraph publishes successfully
  • Verify npm run deps:tree works on Linux CI without backtick errors

GitNexus uses PolyForm Noncommercial License 1.0.0, not MIT.
Add "Commercial use allowed" row to README feature comparison table.
The inline node -e command had backticks that sh on Linux interpreted
as command substitution, causing `sh: 1: n+t+: not found`. Also,
npm ls exits non-zero on ELSPROBLEMS (version mismatches in optional
platform-specific deps), which made execSync throw during publish.

Fix: move to scripts/gen-deps.cjs with try/catch to handle npm ls
failures gracefully, and use --omit=dev to exclude devDependencies.
Add version-exists checks so re-running a failed publish skips
already-published packages instead of failing with 409 Conflict.

- Check main package before publish steps; if already on npm, skip
  both platform and main publish (post-publish steps still run)
- Check each platform package individually before npm publish;
  skip with continue if already published
@greptile-apps
Copy link
Contributor

greptile-apps bot commented Feb 23, 2026

Greptile Summary

Combines 4 bug fixes and 1 documentation correction:

  • CI resilience: workflow now skips already-published packages on re-runs (checks @optave/codegraph first, then per-platform packages), preventing 409 conflicts from partial failures
  • Backtick fix: moved deps:tree from inline node -e (which sh interpreted backticks as command substitution) to scripts/gen-deps.cjs with proper error handling for ELSPROBLEMS non-zero exits
  • Version validation: workflow_dispatch input now validates semver format and strips v prefix
  • License correction: GitNexus was incorrectly listed as MIT — corrected to PolyForm NC (non-commercial) in both README and COMPETITIVE_ANALYSIS.md, plus added "Commercial use allowed" row to feature comparison table

The workflow changes enable safe retries of failed stable releases via workflow_dispatch.

Confidence Score: 4/5

  • safe to merge with minor validation suggested
  • all changes are well-scoped fixes for real CI issues. the workflow idempotency logic is sound (main package check gates both publish steps, per-platform checks prevent duplicate publishes). the script properly handles npm ls non-zero exits. documentation corrections are factually accurate. one minor check recommended: ensure PACKAGES map stays in sync with build matrix platforms.
  • verify .github/workflows/publish.yml PACKAGES map matches build-native matrix exactly

Important Files Changed

Filename Overview
.github/workflows/publish.yml Adds version validation, idempotency checks for re-runs, and resilience to partial failures
scripts/gen-deps.cjs New script to fix backtick command substitution issue and handle npm ls non-zero exits gracefully

Last reviewed commit: 73a1e6b

Copy link
Contributor

@greptile-apps greptile-apps bot left a comment

Choose a reason for hiding this comment

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

5 files reviewed, 1 comment

Edit Code Review Agent Settings | Greptile

Comment on lines +238 to +242
# Skip if this exact version is already published (idempotent re-runs)
if npm view "${pkg_name}@${VERSION}" version 2>/dev/null; then
echo "⚠️ ${pkg_name}@${VERSION} already published — skipping"
continue
fi
Copy link
Contributor

Choose a reason for hiding this comment

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

verify that all 4 platforms in PACKAGES map exactly to the 4 matrix builds in the build-native job. if the matrix changes but PACKAGES doesn't update, publishes could be incomplete.

@carlos-alm carlos-alm merged commit 33f562e into main Feb 23, 2026
20 checks passed
@carlos-alm carlos-alm deleted the fix/combined-pending-changes branch February 23, 2026 02:27
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