Skip to content

File discovery findings as issues from the scheduled job - #4564

Open
evanchooly wants to merge 2 commits into
audits-since-auditfrom
audits-discovery-issues
Open

evanchooly wants to merge 2 commits into
audits-since-auditfrom
audits-discovery-issues

Conversation

@evanchooly

Copy link
Copy Markdown
Member

Step 6 of the operator-audit plan: the scheduled audit job now files its own issues, as you asked. Stacked on #4561.

Problem solved

Discovery found things but nobody heard about them. The weekly job from #4559 only uploaded a report. Now a Publish job runs after it, with issues: write scoped to that job alone. It files three kinds of finding in this repository:

  • Bind <node> for generated operator tests (labels enhancement, aggregation, proposed). There is one issue per unbound MQL node, listing every documented example it blocks. For example, stage $match blocks four examples today.
  • Cover the documented <operator> example "…" (Task, proposed): an example that appeared upstream since the committed inventory, with no test.
  • Generated operator cases fail integration (bug), naming the failing tests parsed from integration.log. The job runs even when Discover fails on integration, because that failure is itself the finding.

PublishMainKt discovery <out> <committed-inventory> <policy> <journal> <owner/repo> [--publish] builds these findings in DiscoveryFindings and runs them through the existing Publisher, which handles markers, reconciliation, metadata repair and closed-issue dispositions. Supporting changes:

  • gaps.json becomes a versioned object, so AuditJson can read it;
  • publication-policy.json labels the new finding types; they all already exist in this repo.

What the first scheduled run will file

A report-only run against MorphiaOrg/morphia plans exactly five issues:

  • Bind stage $match
  • Bind $deserializeEJSON
  • Bind $serializeEJSON
  • Bind $toObject
  • Bind $reduce option valueAs

There are no new examples or integration failures at the committed inventory's docs commit. A manual run can set publish off to preview.

Found and fixed while testing

I filed for real into the sandbox repository (evanchooly/morphia-audits-sandbox):

  • Run 1 created 5 issues.
  • Run 2, same journal: all 5 unchanged.
  • Run 3, fresh journal, seconds later: created 4 duplicates. GitHub's issue listing hadn't yet caught up with issues created seconds before, so their markers weren't found.

Weekly runs are far apart, but a manual rerun soon after a scheduled one would hit the same lag. So:

  • the job now restores the journal from the previous run's operator-publications artifact (that needs actions: read), and a journal-known issue is read by number, which doesn't lag;
  • a concurrency group stops runs from overlapping.

Once the listing caught up, the duplicate-marker guard refused to publish rather than file a third copy. I removed the markers from the sandbox duplicates and closed them.

Decisions for review

  • The target is this repository (github.repository), and scheduled runs always publish. Manual runs publish by default, with an opt-out.
  • The token is github.token, passed as AUDITS_GITHUB_TOKEN. The gateway deliberately strips inherited GH_TOKEN.
  • The capability-coverage findings (MISSING_API, VERSION_ANNOTATION) aren't wired in yet. Their report needs the discovery pipeline's accepted production baseline, which doesn't exist yet.

Also from this round

Verification

  • 448 audits tests pass (3 new).
  • The live sandbox runs above.
  • The workflow parses. It first runs on schedule once it reaches master.

Self-reviewed (the independent reviewer is out until Nov 26).

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