!5269odin/visual-review-env → develop3136a56a90

A View app button for each MR's visual review page

AI-generatedEverything on this page was written by an AI agent from the diff: the summaries, the narration, the diagrams, the flags and the glossary. It can be wrong or incomplete, so check it against the code before you rely on it.

1commits
1files
24lines changed
24lines to read
1new CI job
0runtime lines

Where the diff is

Read these1 files · 24 lines

.gitlab-ci.yml+24 −0

Tests0 files · 0 lines

none

1open MR pipeline2visual-review job passes3View app button shows4link opens page

3-minute explainer

What changed

The button

GitLab shows View app only for head-pipeline deployments.

huginn publishes pagejob records deploymentView app

When it runs

Every same-project MR pipeline; never forks, branches or tags.

fork MR: neverMR: runbranch/tag: no job

What it does

No checkout, no secrets; one per-MR environment, echo only.

GIT_STRATEGY: noneneeds: []allow_failure: trueauto_stop_in: 2 weeks

Until the page exists

Link 404s until huginn publishes; drafts stay 404.

button404published2 wk: stop

Look here first

URL must match huginn's Pages targetMatches publish.py (mr-<iid>.thorchain-mr-reviews.pages.dev); huginn-agent!269's own config not checked here..gitlab-ci.yml:804 ↗verify
795+ rules:
796+ - if: $CI_MERGE_REQUEST_SOURCE_PROJECT_PATH && $CI_MERGE_REQUEST_SOURCE_PROJECT_PATH != $CI_MERGE_REQUEST_PROJECT_PATH
797+ when: never
798+ - if: $CI_MERGE_REQUEST_IID
799+ allow_failure: true
800+ variables:
801+ GIT_STRATEGY: none
802+ environment:
803+ name: review/mr-$CI_MERGE_REQUEST_IID
804+ url: https://mr-$CI_MERGE_REQUEST_IID.thorchain-mr-reviews.pages.dev
805+ deployment_tier: development
806+ auto_stop_in: 2 weeks
807+ script:
808+ - echo "Visual review page at $CI_ENVIRONMENT_URL"
809+
786810 # Copy third-party images the dind jobs pull into this project's registry,
787811 # registry to registry with `docker buildx imagetools`, so no dind daemon is
788812 # involved. Running on protected branches only is not a registry ACL: any
789813 # Developer's CI_JOB_TOKEN can push here too. So the copy is taken by the
790814 # pinned digest, consumers pull by that digest, and a tag that points anywhere
791815 # else is re-pointed.
792816 mirror-ci-images:
793817 rules:
Takes a slot on the small runnerSmall runner has one slot today; this job queues with lint, generate and unit-tests on every MR pipeline..gitlab-ci.yml:792 ↗careful
783783 script:
784784 - make docs-generate
785785
786+# The MR widget's "View app" button. huginn's visual-review service builds a
787+# review page for every open non-draft MR and publishes it to Cloudflare Pages
788+# at this URL (it also keeps the link at the top of the MR description). This
789+# job only records the deployment GitLab needs to show the button: no secrets,
790+# no checkout. The page appears a few minutes to an hour after a new head.
791+visual-review:
792+ tags: !reference [.small-runner, tags]
793+ stage: test
794+ needs: []
795+ rules:
796+ - if: $CI_MERGE_REQUEST_SOURCE_PROJECT_PATH && $CI_MERGE_REQUEST_SOURCE_PROJECT_PATH != $CI_MERGE_REQUEST_PROJECT_PATH
797+ when: never
798+ - if: $CI_MERGE_REQUEST_IID
799+ allow_failure: true
800+ variables:
801+ GIT_STRATEGY: none
802+ environment:
803+ name: review/mr-$CI_MERGE_REQUEST_IID
804+ url: https://mr-$CI_MERGE_REQUEST_IID.thorchain-mr-reviews.pages.dev
805+ deployment_tier: development
No on_stop: environment outlives mergeWithout an on_stop job GitLab can't stop it on merge/close; it lingers until the two-week auto-stop..gitlab-ci.yml:806 ↗careful
797+ when: never
798+ - if: $CI_MERGE_REQUEST_IID
799+ allow_failure: true
800+ variables:
801+ GIT_STRATEGY: none
802+ environment:
803+ name: review/mr-$CI_MERGE_REQUEST_IID
804+ url: https://mr-$CI_MERGE_REQUEST_IID.thorchain-mr-reviews.pages.dev
805+ deployment_tier: development
806+ auto_stop_in: 2 weeks
807+ script:
808+ - echo "Visual review page at $CI_ENVIRONMENT_URL"
809+
786810 # Copy third-party images the dind jobs pull into this project's registry,
787811 # registry to registry with `docker buildx imagetools`, so no dind daemon is
788812 # involved. Running on protected branches only is not a registry ACL: any
789813 # Developer's CI_JOB_TOKEN can push here too. So the copy is taken by the
790814 # pinned digest, consumers pull by that digest, and a tag that points anywhere
791815 # else is re-pointed.
792816 mirror-ci-images:
793817 rules:
794818 - if: $CI_COMMIT_BRANCH && $CI_COMMIT_REF_PROTECTED == "true"
795819 stage: build
Runs on draft MRs tooRule only checks CI_MERGE_REQUEST_IID; huginn skips drafts, so their View app link 404s..gitlab-ci.yml:798 ↗look
789+# job only records the deployment GitLab needs to show the button: no secrets,
790+# no checkout. The page appears a few minutes to an hour after a new head.
791+visual-review:
792+ tags: !reference [.small-runner, tags]
793+ stage: test
794+ needs: []
795+ rules:
796+ - if: $CI_MERGE_REQUEST_SOURCE_PROJECT_PATH && $CI_MERGE_REQUEST_SOURCE_PROJECT_PATH != $CI_MERGE_REQUEST_PROJECT_PATH
797+ when: never
798+ - if: $CI_MERGE_REQUEST_IID
799+ allow_failure: true
800+ variables:
801+ GIT_STRATEGY: none
802+ environment:
803+ name: review/mr-$CI_MERGE_REQUEST_IID
804+ url: https://mr-$CI_MERGE_REQUEST_IID.thorchain-mr-reviews.pages.dev
805+ deployment_tier: development
806+ auto_stop_in: 2 weeks
807+ script:
808+ - echo "Visual review page at $CI_ENVIRONMENT_URL"
809+
786810 # Copy third-party images the dind jobs pull into this project's registry,
787811 # registry to registry with `docker buildx imagetools`, so no dind daemon is
Inherits the default golang imageNo image: key, so echo runs in golang:1.26.10; usually cached on the runner, but alpine would do..gitlab-ci.yml:791 ↗look
782782 - public
783783 script:
784784 - make docs-generate
785785
786+# The MR widget's "View app" button. huginn's visual-review service builds a
787+# review page for every open non-draft MR and publishes it to Cloudflare Pages
788+# at this URL (it also keeps the link at the top of the MR description). This
789+# job only records the deployment GitLab needs to show the button: no secrets,
790+# no checkout. The page appears a few minutes to an hour after a new head.
791+visual-review:
792+ tags: !reference [.small-runner, tags]
793+ stage: test
794+ needs: []
795+ rules:
796+ - if: $CI_MERGE_REQUEST_SOURCE_PROJECT_PATH && $CI_MERGE_REQUEST_SOURCE_PROJECT_PATH != $CI_MERGE_REQUEST_PROJECT_PATH
797+ when: never
798+ - if: $CI_MERGE_REQUEST_IID
799+ allow_failure: true
800+ variables:
801+ GIT_STRATEGY: none
802+ environment:
803+ name: review/mr-$CI_MERGE_REQUEST_IID
804+ url: https://mr-$CI_MERGE_REQUEST_IID.thorchain-mr-reviews.pages.dev
allow_failure keeps it out of auto-cancelworkflow on_job_failure: all ignores allow_failure jobs, so a failure here never cancels the pipeline..gitlab-ci.yml:799 ↗look
790+# no checkout. The page appears a few minutes to an hour after a new head.
791+visual-review:
792+ tags: !reference [.small-runner, tags]
793+ stage: test
794+ needs: []
795+ rules:
796+ - if: $CI_MERGE_REQUEST_SOURCE_PROJECT_PATH && $CI_MERGE_REQUEST_SOURCE_PROJECT_PATH != $CI_MERGE_REQUEST_PROJECT_PATH
797+ when: never
798+ - if: $CI_MERGE_REQUEST_IID
799+ allow_failure: true
800+ variables:
801+ GIT_STRATEGY: none
802+ environment:
803+ name: review/mr-$CI_MERGE_REQUEST_IID
804+ url: https://mr-$CI_MERGE_REQUEST_IID.thorchain-mr-reviews.pages.dev
805+ deployment_tier: development
806+ auto_stop_in: 2 weeks
807+ script:
808+ - echo "Visual review page at $CI_ENVIRONMENT_URL"
809+
786810 # Copy third-party images the dind jobs pull into this project's registry,
787811 # registry to registry with `docker buildx imagetools`, so no dind daemon is
788812 # involved. Running on protected branches only is not a registry ACL: any

Ask an AI about this change

Chat assistantClaude, ChatGPT, … (reads a link)

Coding agentClaude Code, Cursor, … (reads the repo)

The context file is context.md. Use Copy with context for an AI that can't open links; it pastes the whole file in.

Glossary

.small-runner
Template that tags short gate jobs for the small-slot runner; defined in .gitlab-ci.yml. .gitlab-ci.yml ↗
auto_stop_in
Environment setting that stops it a set time after its last deployment; here two weeks. GitLab CI YAML ↗
Cloudflare Pages
Static hosting where huginn uploads each MR's page as its own branch, mr-<iid>. Cloudflare Pages docs ↗
GIT_STRATEGY: none
Runner variable that skips cloning the repo, so the job runs without the source tree. GitLab runner Git strategy ↗
GitLab environment
A named deploy target GitLab tracks per job; the MR widget shows a View app button for ones the head pipeline deployed. GitLab environments ↗
huginn
THORChain's automation agent; its visual-review service builds and publishes the review page this job links to.
on_stop
Optional job GitLab runs to stop an environment, including when an MR merges or closes; this job sets none. GitLab CI YAML ↗
Visual review page
A per-MR page with an explainer video, change cards and flagged diffs, published at mr-<iid>.thorchain-mr-reviews.pages.dev.