Skip to content

Fix workflow stability and NuGet publishing authorization - #8

Merged
konard merged 3 commits into
mainfrom
issue-7-497d9113d746
Oct 7, 2026
Merged

konard merged 3 commits into
mainfrom
issue-7-497d9113d746

Conversation

@konard

@konard konard commented Oct 7, 2026 •

Copy link
Copy Markdown
Member

Fix the workflow stability defects in #5 and the NuGet authorization and trusted-publishing gaps in #6 in this single PR.

The old NuGet preflight treated creation of a verification key as proof that an API key could publish the configured package. The suggested temporary-key check alone also misses a wrong package glob: NuGet replaces that glob with the requested ID when creating the temporary key. Preflight now verifies the original publishing key as well, so a key whose glob or owner forbids the package cannot be reported as verified.

Changes

  • Pin all 27 literal runner labels and the full compiler matrix to ubuntu-24.04, macos-15 and windows-2025, with repository-wide policy tests.
  • Hash-pin lychee and zizmor, retain version comments and Dependabot updates, and remove their zizmor tag-pin exemptions.
  • Configure Git's initial branch before checkout in workflows.yml; enforce the same configuration in all five active workflows.
  • Complete the NuGet verification flow: create a temporary key with Content-Length: 0, find an existing published version through the public index, consume the temporary key with GET /api/v2/verifykey/{id}/{version}, then verify the original API key at the same endpoint. Both verification calls must return 200. HTTP 401/403 fails; missing versions, 404, malformed responses, rate limits and network uncertainty remain unknown.
  • Support trusted publishing in both automatic and instant release jobs through hash-pinned NuGet/login, job-scoped permission to issue OIDC tokens and vars.NUGET_USER. Pass the temporary API-key output to the existing masked push command. Leave NUGET_USER unset to use the existing secret fallback; login failures stop the release.
  • Report the selected authentication mode, keep opt-in HTTP diagnostics free of keys, and update setup instructions, including NuGet policies for renamed multi-language workflow files.
  • Add a patch changelog fragment; the release pipeline performs the version bump.

Requirements and research

The complete requirement-by-requirement analysis lists every requirement from #5, #6 and #7, solution plans, alternatives, existing components, verified action hashes and limits. Both reported issues were reproduced and addressed; none is deferred. The audit covers all five active workflows, both publishing jobs, scripts, tests and current documentation. Historical workflow snapshots remain research evidence.

NuGetGallery's CredentialBuilder explains why temporary-key success cannot establish the original glob. Its verification implementation accepts ordinary push keys and checks their original scopes. The same behavior was checked in current upstream source. Research also covers the official trusted-publishing setup, NuGet/login, runner/action policies and related Interfaces PR #151. The solution reuses pytest, the local HTTP fixture, Python's standard library, actionlint/shellcheck and zizmor without a new production dependency.

Reproduction and validation

The smallest remaining wrong-glob reproducer is test_temporary_key_cannot_prove_original_package_glob: POST and temporary-key verification return 200, but the original key is refused with 401/403. Before the correction, the seven new or strengthened focused cases failed; the fixed script rejects the denied credential and preserves unknown results. No live publishing credential or package push is needed.

python3 -m pytest -q scripts/tests/test_preflight_credentials.py -k temporary_key_cannot
python3 -m pytest -q scripts/tests

Local validation:

  • 306 script tests passed; 94 focused preflight/publisher/workflow tests passed.
  • C++ Debug, Release and ASan/UBSan: 10 tests passed in each preset.
  • Pinned clang-format, clang-tidy and cppcheck; all five consumer examples passed.
  • Pinned actionlint Docker image with shellcheck, shellcheck on both release scripts, both zizmor audit passes, required documentation, file-size and whitespace checks passed.

GitHub CI passed on final commit b7917b2aec70b6e0a2d479c9636ef1d39f20ee46: all five runs started at 2026-10-07T07:22:38Z, after the commit at 07:22:32Z. There are 28 passing checks, 5 expected skips, and no pending or failing checks: CI/CD Pipeline, Workflows, Security, Docs, and Broken Link Checker. The workflow logs contain no Git default-branch hints or Ubuntu migration notice. The PR merge ref has zero open code-scanning alerts. Logs are preserved locally in ci-logs/ and experiments/issue-7/.

Trusted publishing requires the documented nuget.org policy and NUGET_USER configuration. Deferred OIDC exchange and first-push scope are reported as unknown, preserving the existing verdict rules. Explicit runner labels fix OS generations while GitHub continues updating their tools; the macOS capacity notice is external.

Reverified at 2026-10-07 07:39 UTC on unchanged commit b7917b2: all 306 script tests, C++ Debug/Release/ASan/UBSan (10 tests per preset), all five consumer examples, pinned C++ lint, actionlint/shellcheck, both zizmor passes and documentation/size/whitespace checks passed again. A fresh replay against main and the temporary-key-only implementation reproduced the wrong-glob false positive; the current implementation rejected both 401 and 403. Fresh CI logs match this head and contain no Git initial-branch hint or Ubuntu migration notice. GitHub's closingIssuesReferences API explicitly recognizes #5, #6 and #7. All 22 requirements and their alternatives/implementation plans are mapped in the linked case study. Current official documentation, NuGetGallery source and all three action hashes were checked again. Both sub-issues are already fully implemented on this head; no further source changes are needed. main is already included in the branch and the working tree is clean. Fresh logs are preserved in ci-logs/restart-3/ and experiments/issue-7/*restart-3.log.

Fixes #5
Fixes #6
Fixes #7

Changes

  • 18 file(s) modified
  • 690 line(s) added
  • 93 line(s) removed
  • Files:
    • .github/workflows/docs.yml
    • .github/workflows/links.yml
    • .github/workflows/release.yml
    • .github/workflows/security.yml
    • .github/workflows/workflows.yml
    • .github/zizmor.yml
    • README.md
    • changelog.d/20261007_070000_ci_and_nuget_publishing.md
    • docs/case-studies/issue-1/README.md
    • docs/case-studies/issue-7/README.md
    • docs/ci-cd.md
    • docs/distribution.md
    • docs/multi-language.md
    • scripts/preflight-credentials.sh
    • scripts/publish-release.sh
    • scripts/tests/test_preflight_credentials.py
    • scripts/tests/test_publish_release.py
    • scripts/tests/test_workflows.py

Adding .gitkeep for PR creation (default mode).
This file will be removed when the task is complete.

Issue: #7
@konard konard self-assigned this Oct 7, 2026
@konard konard changed the title [WIP] Address all 2 open issues in link-foundation/cpp-ai-driven-development-pipeline-template Fix workflow stability and NuGet publishing authorization Oct 7, 2026
@konard
konard marked this pull request as ready for review October 7, 2026 07:12
@konard

konard commented Oct 7, 2026

Copy link
Copy Markdown
Member Author

Working session summary

Implemented all requirements across the active codebase: runner/action pins, Git configuration, accurate NuGet authorization checks, and trusted publishing.

PR #8 is ready for review. All 28 CI checks pass; 300 local script tests and C++/package checks pass. Working tree is clean.

Full analysis lists every requirement, solution plan, researched component, and limitation.


This summary was automatically extracted from the AI working session output.

@konard

konard commented Oct 7, 2026

Copy link
Copy Markdown
Member Author

🤖 Solution Draft Log

This log file contains the complete execution trace of the AI solution draft process.

💰 Cost estimation:

  • Model: GPT-6.1 Sol
  • Provider: OpenAI
  • Public pricing estimate: $1.968488

📊 Context and tokens usage:

  • 210.6K input tokens across requests (cumulative, larger than the 200K context window, so not one request's context), 31.3K / 128K (24%) output tokens

Total: (210.6K + 3.3M cached) input tokens, 31.3K output tokens, $1.968488 cost

🤖 Models used:

  • Tool: OpenAI Codex
  • Requested: gpt-6.1-sol
  • Thinking level: xhigh (~31999 tokens)
  • Model: GPT-6.1 Sol (gpt-6.1-sol)

📎 Log file uploaded as Gist (2989KB)


Now working session is ended, feel free to review and add any feedback on the solution draft.

@konard
konard marked this pull request as draft October 7, 2026 07:13
@konard
konard marked this pull request as ready for review October 7, 2026 07:26
@konard
konard marked this pull request as draft October 7, 2026 07:26
@konard
konard marked this pull request as ready for review October 7, 2026 07:33
@konard
konard marked this pull request as draft October 7, 2026 07:33
@konard
konard marked this pull request as ready for review October 7, 2026 07:39
@konard

konard commented Oct 7, 2026

Copy link
Copy Markdown
Member Author

🤖 Solution Draft Log

This log file contains the complete execution trace of the AI solution draft process.

🤖 Models used:

  • Tool: OpenAI Codex
  • Requested: gpt-6.1-sol
  • Thinking level: xhigh (~31999 tokens)
  • Model: GPT-6.1 Sol (gpt-6.1-sol)

📎 Log file uploaded as Gist (7980KB)


Now working session is ended, feel free to review and add any feedback on the solution draft.

@konard
konard merged commit af84755 into main Oct 7, 2026
33 checks passed
@konard

konard commented Oct 7, 2026

Copy link
Copy Markdown
Member Author

🎉 Auto-merged

This pull request has been automatically merged by hive-mind.

  • All CI checks have passed

Auto-merged by hive-mind with --auto-merge flag

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment