Skip to content

Conversation

@oberstet
Copy link
Contributor

@oberstet oberstet commented Oct 7, 2025

Description

final round (part 4b) of CI/CD and docs improvements before rel v25.9.1


Related Issue(s)

Closes or relates to #1677


Checklist

  • I have referenced relevant issue numbers above
  • I have performed a self-review of my code and it follows
    the style guidelines of this project
  • I have added new or used existing tests that prove my fix
    is effective or that my feature works
  • I have added necessary documentation (if appropriate) and
    updated the changelog
  • I have added an AI assistance disclosure file (required!)
    in this PR

@oberstet oberstet changed the title allow manual dispatch to allow debug GH actions shit part 4b rel v25.9.1 Oct 7, 2025
- Generate unique summary filename: {repo}-{branch}-{pr}-wstest-summary.md
- Update summary headers with repo/branch/PR info instead of timestamp
- Replace artifact upload with git commit to .audit/ directory
- Only commit if file is new or changed
- This enables reuse in post-summary.yml workflow
- Use workflow_run trigger instead of pull_request_target for better security
- Add workflow_dispatch for manual testing and debugging
- Extract PR info dynamically from workflow_run event or manual input
- Checkout PR branch directly instead of downloading artifacts
- Check if summary file exists and was changed before commenting
- Use thollander/actions-comment-pull-request for better comment management
- Only comment when summary file is new or updated
- Remove dependency on fine-grained PAT, use standard GITHUB_TOKEN
- Add pull_request_target to run in main repo context (required for GITHUB_TOKEN write permissions)
- Keep workflow_run and workflow_dispatch triggers for completeness
- Handle all three trigger types in PR info extraction logic
- This fixes the limitation where forked PRs cannot write comments with standard GITHUB_TOKEN
- Escape dollar sign in commit message template to prevent YAML parsing issues
- The unescaped variable reference was causing workflow validation to fail
- Replace '/' in repo name with '--' to create flat filename in .audit/ directory
- Use double dash as separator for clean parsing: user--repo--branch--pr--wstest-summary.md
- This avoids creating subdirectories and fixes the 'No such file or directory' error
- Result: oberstet--autobahn-python--rel_v25.9.1_part4b--1680--wstest-summary.md
- Add 'git checkout -b' to create local branch from detached HEAD
- This allows pushing to the PR branch since GitHub Actions checks out in detached HEAD by default
- Fixes 'src refspec does not match any' error when pushing changes
wstest.yml:
- Remove git commit/push that was failing due to permissions
- Upload summary file as workflow artifact instead
- Use standard artifact naming: conformance-summary-{TEST_MODE}

post-summary.yml:
- Replace git checkout with artifact download
- Find summary file dynamically in downloaded artifact
- Use artifact file path for PR commenting
- This avoids fork permission issues while maintaining functionality
- Rename post-summary.yml → release.yml to reflect expanded scope
- Add unified publish-github-release job that:
  * Triggers via workflow_run after wheels/wheels-docker complete
  * Downloads artifacts from both workflows using pattern matching
  * Consolidates all artifacts into single release directory
  * Uses release_type and release_name from centralized identifiers
  * Creates ONE unified GitHub release (eliminates duplicate releases)
  * Only runs for nightly and official releases (skips development/PR builds)
- Remove publish-github-releases job from wheels.yml
- Remove publish-github-releases job from wheels-docker.yml

This eliminates the previous pattern where wheels.yml and wheels-docker.yml
each created separate releases (wheels-YYYYMMDD-SHA and wheels-docker-YYYYMMDD-SHA).
Now there is a single unified release per build with all wheels consolidated.

The release workflow uses the centralized .cicd/workflows/identifiers.yml
helper to get consistent release_type and release_name values across all
workflows.
…ted PyPI/RTD publishing

1. Use explicit positive filtering for release types
   - Changed from 'release_type != development' to explicit positive list
   - publish-github-release: filters for 'nightly' or 'release'
   - publish-pypi-release: filters for 'release' only
   - Safer and more maintainable than negative filtering

2. Replace bash heredoc templates with separate Jinja2 templates
   - Created .github/templates/release-nightly.md.j2
   - Created .github/templates/release-official.md.j2
   - Eliminates bash escaping hell and double YAML embedding issues
   - Template variables: release_name, commit_sha, build_date, wheel_count, sdist_count
   - Install jinja2-cli and render templates in workflow
   - Use --notes-file with rendered markdown for gh release create

3. Add consolidated PyPI and RTD publishing job
   - New publish-pypi-release job in release.yml
   - Consolidates publish-pypi from wheels.yml and wheels-docker.yml
   - Consolidates publish-rtd from wheels.yml
   - Filters for release_type == 'release' (official releases only)
   - Downloads wheels from both wheel workflows
   - Publishes to PyPI using trusted publishing
   - Triggers RTD documentation build
   - Remove redundant publish-pypi/publish-rtd jobs from wheels.yml
   - Remove redundant publish-pypi job from wheels-docker.yml

All release publishing (GitHub Releases, PyPI, RTD) is now centralized
in the release.yml workflow with proper filtering and template separation.
1. Rename template file for consistency
   - release-official.md.j2 -> release-stable.md.j2
   - Matches the release_type naming convention

2. Update release_type references throughout release.yml
   - Changed 'release' -> 'stable' in all filter conditions
   - Changed 'release' -> 'stable' in template selection logic
   - Changed 'release' -> 'stable' in release title logic
   - Aligns with updated identifiers.yml that uses 'stable' for tagged releases

3. Rename jobs for maximum consistency
   - publish-github-release -> release-nightly
   - publish-pypi-release -> release-stable
   - post-pr-summary -> release-development

This creates perfect symmetry across the release system:
- Release types: development, nightly, stable
- Job names: release-development, release-nightly, release-stable
- Templates: release-nightly.md.j2, release-stable.md.j2

All naming now consistently reflects the three-tier release strategy:
- development: PR builds with conformance testing summaries
- nightly: Automated nightly builds from master branch
- stable: Official tagged releases published to PyPI and RTD
…native GitHub CLI

1. Create release-development.md.j2 template
   - Completes the template trio: development, nightly, stable
   - Provides structured PR comment with build information
   - Includes PR details, build info, workflow links, wstest summary
   - Variables: pr_number, pr_repo, pr_branch, base_repo, base_branch,
     commit_sha, build_date, workflow_run_url, wheel_count, wstest_summary

2. Update release-development job to use Jinja2 template
   - Add checkout step (needed to access templates)
   - Install jinja2-cli for template rendering
   - Collect all template variables from PR context and environment
   - Read wstest summary file content if available
   - Render template with all variables
   - Generate pr-comment.md from template

3. Replace thollander/actions-comment-pull-request with gh pr comment
   - Remove external third-party dependency
   - Use native GitHub CLI (gh) already available in Actions
   - Use --body-file flag with rendered template
   - More secure, robust, and maintainable
   - Simpler implementation

Benefits:
- Perfect template symmetry across all release types
- Eliminates external dependency (thollander action)
- More secure and maintainable using native GitHub CLI
- Consistent Jinja2 templating approach for all release notes
- Clean separation of content (templates) from logic (workflow)
…ubmodule

GitHub Actions parses workflow files BEFORE checking out submodules, so
references to ./.cicd/workflows/identifiers.yml fail with "no version specified".

Solution: Reference the reusable workflow directly from its source repository:
  uses: wamp-proto/wamp-cicd/.github/workflows/identifiers.yml@main

The .cicd submodule is still required at runtime because identifiers.yml
needs to access scripts/sanitize.sh during execution.

Updated all 5 workflows that use the identifiers reusable workflow:
- .github/workflows/main.yml
- .github/workflows/release.yml
- .github/workflows/wheels-docker.yml
- .github/workflows/wheels.yml
- .github/workflows/wstest.yml

Added explanatory comments to clarify why we must use the remote reference
instead of the local submodule path, and why the submodule is still needed.
The wamp-cicd repository stores workflows at /workflows/ not /.github/workflows/

Changed:
  uses: wamp-proto/wamp-cicd/.github/workflows/identifiers.yml@main

To:
  uses: wamp-proto/wamp-cicd/workflows/identifiers.yml@main

Updated all 5 workflows:
- .github/workflows/main.yml
- .github/workflows/release.yml
- .github/workflows/wheels-docker.yml
- .github/workflows/wheels.yml
- .github/workflows/wstest.yml
Changed back to:
  uses: wamp-proto/wamp-cicd/.github/workflows/identifiers.yml@main

GitHub Actions requires reusable workflows to be at .github/workflows/ even
for external repos. We added a symlink in wamp-cicd to work around this while
keeping the canonical workflow at workflows/identifiers.yml.

Symlink structure in wamp-cicd:
  .github/workflows/identifiers.yml -> ../../workflows/identifiers.yml

This allows:
- Remote reference via .github/workflows/ (GitHub Actions requirement)
- Local submodule access via workflows/ (actual file location)
- Scripts access to scripts/sanitize.sh from the canonical location

Updated all 5 workflows:
- .github/workflows/main.yml
- .github/workflows/release.yml
- .github/workflows/wheels-docker.yml
- .github/workflows/wheels.yml
- .github/workflows/wstest.yml
@oberstet oberstet merged commit 1c2d279 into crossbario:master Oct 9, 2025
20 checks passed
@oberstet oberstet deleted the rel_v25.9.1_part4b branch October 9, 2025 22:25
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