Skip to content

File audit issues in the milestone the pom's version names - #4566

Open
evanchooly wants to merge 1 commit into
audits-design-docfrom
audits-milestone
Open

evanchooly wants to merge 1 commit into
audits-design-docfrom
audits-milestone

Conversation

@evanchooly

Copy link
Copy Markdown
Member

Follows up the milestone question on #4556. Stacked on #4565.

Problem

The publisher could only put issues in a milestone named in publication-policy.json, and the policy names none ("milestone": null). So the scheduled discovery job (#4564) would file issues with no milestone. You decided they should join the next release's milestone, as the pom's version names it, with the milestone created first when it doesn't exist.

Example: the root pom is at 3.0.0-SNAPSHOT, so issues join milestone 3.0.0 (#65 today). After the 3.0.0 release, when the pom moves to 3.0.1-SNAPSHOT, the first run with something to file creates 3.0.1 and files into it.

Change

  • ProjectMilestone.of(pom) reads the pom's own project/version, not the parent's or a dependency's, and removes -SNAPSHOT. Anything that isn't major.minor.patch (for example ${revision}) is rejected. The XML parser refuses doctypes.
  • Publisher takes the milestone title:
    • if an open milestone with that title exists, it's used;
    • if none exists, it's created first, but only when publishing and there are findings. A quiet run creates nothing, and report-only mode never writes;
    • if the milestone is closed, publication stops, because that version has already shipped and the pom is stale.
  • GhGateway.createMilestone: a publishing gateway may now also POST repos/O/R/milestones. Like an issue create, it is never replayed. The workflow's issues: write permission covers milestones.
  • PublishMainKt takes the pom path as a positional argument (… <journal.json> <pom.xml> <OWNER/REPO>), and the workflow passes $PWD/pom.xml. publication-policy.json drops its milestone field.
  • Docs: the README, the reference, the design doc and the progress file are updated.

Decisions for review

  • "Next version" means the version the pom is building: 3.0.0-SNAPSHOT → 3.0.0, not 3.0.1. Tell me if you meant to bump the patch.
  • The milestone is created lazily, only when a run has findings to publish, so quiet runs don't create empty milestones.
  • A closed milestone fails the run instead of creating a duplicate or filing into a shipped release.

Verification

  • Audits suite: 452 tests pass under Critter, then reflection.
  • New tests cover: creating a missing milestone only when there's something to publish; reusing it on the next run; stopping on a closed one; the version parsing (parent, dependency, missing and non-numeric versions, and the real root pom); the gateway's milestone POST; and report-only mode refusing it.
  • The sandbox publisher and gateway tests pass against evanchooly/morphia-audits-sandbox.

Self-reviewed only: the independent reviewers are out of quota until 2026-11-26.

Issues join the milestone of the release the root pom builds, its version
without -SNAPSHOT. The publisher creates that milestone first when it is
missing and there is something to publish, and stops on a closed one.
PublishMainKt takes the pom as an argument, the policy no longer names a
milestone, and the gateway may also create milestones.

This branch has not been deployed

No deployments
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