Skip to content

Replace the wiki page with a GitLab Pages site for picking release targets - #12

Open
lesnik512 wants to merge 10 commits into
mainfrom
report-candidates
Open

lesnik512 wants to merge 10 commits into
mainfrom
report-candidates

Conversation

@lesnik512

Copy link
Copy Markdown
Member

Replaces the GitLab wiki output with a static site that GitLab Pages serves from a scheduled pipeline. On the page you pick a target tag per service and copy the result into a Jira release and a release post.

What changes

  • collect --output DIR writes report.json, plus index.html, Alpine.js 3.17.4 and its MIT license from the wheel.
    • Alpine was taken from the npm tarball and checked against the registry's sha512 integrity hash.
    • The page fetches report.json from the same folder and keeps no data of its own.
    • No separate UI command is needed, because the UI always comes from the same package version as the data.
  • render, publish and the wiki API methods are removed. There are no users yet, so there is no compatibility layer.
  • Report schema 3
    • Service.candidates: one candidate per tag in the range, newest first. Each carries:
      • its tag and that tag's pipeline;
      • rows, the number of rows from its row down to production;
      • the deduplicated in-scope Jira keys of those rows;
      • a compare URL from the production ref (or the sha when production isn't a tag deploy).
    • The browser only merges the picked candidates' keys, so the release logic stays in Python under pytest.
    • --jira mode: rows above the latest linked change are kept, with in_scope: false. Their tags can still be picked, but their Jira keys are neither looked up nor counted.
    • Service.truncated: marks a range that was cut at RELEASE_SCOPE_MAX_COMMITS, because the oldest candidates then miss rows and keys.
  • Page
    • Each service with a production deploy is one line, <details name="services">, so only one is open at a time.
    • The line shows the production ref, the picked target, the number of rows and tasks, failed jobs, and a truncated mark when it applies.
    • Opening a line shows the rows table with a pick button per tag. Picking highlights the rows that tag ships and closes the line.
    • A --jira report starts with each service's release tag picked.
    • At the bottom, three lists span all picked services:
      • deduplicated Jira tasks, as plain keys and as JQL;
      • tag pipelines, as Markdown;
      • compare links, as Markdown.
    • Each list has a copy button plus a read-only text box, since the clipboard API needs HTTPS.
    • Services without a production deploy are left out of the page.

Why this layout

The layout is variant A of three prototypes. The prototype lives on the throwaway branch prototype/service-picker, with the verdict in its commit message. The research behind the Pages approach is in docs/research/gitlab-pages-report.md.

CI shape

The README documents one scheduled job:

release-report:
  image: ghcr.io/astral-sh/uv:python3.13-trixie-slim
  rules:
    - if: $CI_PIPELINE_SOURCE == "schedule"
  script:
    - uvx --from 'release-scope>=0.5,<0.6' release-scope collect --group team/backend --output public || [ $? -eq 1 ]
  pages: true
  • Exit code 1 means some services failed. The job still succeeds, because Pages deploys only from a successful job, and the page shows the errors.
  • Exit codes 2 to 4 (configuration, token, group or project access) fail the job and keep the previous site.
  • Image: the image tag is listed in uv's Docker guide.
  • GitLab versions: the README notes that pages: true needs 17.6 and that 17.10 adds the automatic public artifact.
  • Access control: the README notes that without it, a Pages site is public.

Docs

  • CONTEXT.md adds Candidate and rows above the target.
  • AGENTS.md names _candidates.py and _static/.
  • The README replaces the Page and Wiki sections with Site and GitLab Pages.
  • The skill is pinned to >=0.5,<0.6 and reads report.json from the output folder.

Testing

  • just test-ci reports 109 passed at 100% line coverage, and lint and ty are clean.
  • The page JS has no automated tests. I checked it by hand in a browser against generated reports:
    • picking a tag, then clearing the target;
    • a --jira report starting with its release tag picked;
    • an out-of-scope row dimmed and its keys excluded;
    • a failed service showing its error;
    • the truncated mark;
    • phone width (375px) with no horizontal page scroll.

Releasing this as 0.5.0 is a breaking change.

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