Repository navigation
feat: add opt-in GitLab project delivery - #6866
dimasmjunior wants to merge 18 commits into
Conversation
|
Speaking as Kun's firstmate: thanks, @dimasmjunior. I read the thread and the diff of head What it does: it adds
Security review before approving fork CI: there are no workflow, secret or CI-config edits. New process calls are Contract-class: new-default. The GitLab binding itself is opt-in. But the bootstrap tool/auth change applies to every home without configuration. That includes GitHub Enterprise-only homes, where VISION.md, rule by rule
Heads-up: #6868 rewrites the same PR-URL parser, merge, teardown and backlog-transition code for GitHub hosts, so whichever lands second will need a rebase. Next step: fork CI is now running. Nothing is needed from you unless it goes red. |
|
Speaking as Kun's firstmate (OSS triage, not the captain). Thanks @dimasmjunior. New head Contract-class: new-default (re-verified). GitLab project binding itself is opt-in, but bootstrap tool/auth changes apply without GitLab config (drop VISION.md
Security FYI: loosens a GitLab merge-authority refusal; changes default bootstrap auth detection (GHE-only homes can newly report Fork CI approved this head: |
8f71099 to
b2c51f9
Compare
|
Speaking as Kun's firstmate (OSS triage, not the captain). Thanks @dimasmjunior for rebasing this onto current main. I read the new head Contract-class: new-default (my own check, same as last time). The
On top of that, the GitLab guard now merges an MR that has no head pipeline when the project's VISION.md, rule by rule
Security review before approving fork CI: no workflow, secret or CI-config edits. The new process calls are One gentle ask, if you have the time: the testing note says no real GitLab server was exercised. If you could push one real MR through the guarded merge path on a GitLab instance (gitlab.com is fine) and post the evidence, it would make Kun's decision much easier. That covers both the pipeline-required refusal and the no-pipeline allowance. Re-raising through no-mistakes with that scenario works too. No rush, and thank you for sticking with this one. Outcome: waiting-ci. When CI is green, Kun decides merge or leave. This won't auto-merge. Heads-up: #6970 (yours too) touches the same GitLab merge and review surfaces. |
|
Speaking as Kun's firstmate: a quick update on
This is now waiting on you, no rush. A re-raise through no-mistakes with those two fixed will refresh the attestation. The earlier ask about real-GitLab evidence still stands as a nice-to-have for Kun's decision. Contract-class is still new-default, so once green it goes to Kun to merge or leave. |
|
I exercised
The successful and deliberately failing jobs both ran on the instance's existing runner. Commands exercised, with local paths and identifiers replaced by variables: FM_HOME="$LAB_HOME" bash "$SOURCE/bin/fm-pr-check.sh" "$TASK_ID" "$MR_URL"
FM_HOME="$LAB_HOME" bash "$SOURCE/bin/fm-pr-merge.sh" "$TASK_ID" "$MR_URL"The scratch project, local clone, lab home and source export were removed afterwards. |
|
Speaking as Kun's firstmate: thank you @dimasmjunior, on both counts. Real-GitLab evidence: the run on self-hosted GitLab CE 19.4.1 with New head Contract-class: new-default (unchanged, my own read). The VISION.md: unchanged from my last pass. Authority is the one tension (the no-pipeline merge allowance is Kun's call); every other rule aligns. Next step: waiting on CI. If it's green, this goes to Kun to merge or leave. Heads-up: #6970 touches the same GitLab merge and review surfaces. |
af42d61 to
0cdd811
Compare
|
The latest head is waiting for maintainer approval to run the Require no-mistakes workflow. No jobs ran in https://github.com/kunchenguid/firstmate/actions/runs/38849572156. Could you approve that run so CI can report on this version? |
|
Speaking as Kun's firstmate: thanks @dimasmjunior. Both runs for this head are approved now: CI New head Contract-class: new-default (unchanged, my own read). Setting Next step: waiting on CI. Nothing is needed from you right now. If CI goes green, the decision is Kun's: merge or leave. That will be a captain-decision hold, not something waiting on you. #6970 still overlaps the same GitLab merge and review surfaces. |
A project can now be registered with forge=gitlab next to the existing forge=gerrit binding. Workers on a GitLab-bound task are told to create the merge request, check that it is not a draft, and wait on its pipeline with glab instead of gh-axi. The existing spawn and scout-promotion checks compare the brief with the registered binding. Intake can propose it from the origin host or glab's local config, but registration still needs confirmation. Intake evidence prints only the host, keeping embedded origin credentials out of the report. +yolo stays available, and local-only still refuses any forge. Arming a merge watch refuses a positive GitLab draft. Merge-time verification independently requires a boolean-false draft field and binds the operation to the verified head SHA. Ordinary GitLab merges explicitly disable auto-merge; asynchronous requests need an attended override. Success requires readback proving the MR merged, while an unproven outcome leaves monitoring armed and returns nonzero. A present head pipeline must have succeeded at the current head. When there is none, the guarded merge reads the project's only_allow_merge_if_pipeline_succeeds setting and accepts absence only when it is false. An unreadable setting refuses that absent-pipeline case; successful current-head pipelines need no project-setting read. Cleanup proves landed work through glab, by recorded URL or source branch, and fetches refs/merge-requests/<iid>/head when its head is no longer local. GitLab completion links are kept as backlog notes because tasks-axi accepts only GitHub and Forgejo pull-request links. Bootstrap scopes authentication to each selected host, resolves SSH aliases, and reports missing glab or jq for bound GitLab clones. The creation instructions cover approved GitLab instances, namespaces, and visibility under the existing exact-consent requirement.
…ion documentation
Supply the required forge library in both teardown fixtures. Use generation-aware ensure-listening in the remote-reply helper instead of its racy liveness check. Keep all existing assertions unchanged. Both full suites, five repeated NUL probes, lint, and diff checks passed.
…_gerrit_direct_pr_publishes_one_change in tests/fm-task-delivery.test.sh (rebase leftover; the first copy was shadowed, which caused shellcheck SC2329). The suite passes and shellcheck on that file prints nothing. Behavior portable parallel 2: tests/fm-brief.test.sh still asserted that --forge gitlab is refused; fm-brief now accepts gitlab and its message is 'expected none, gerrit, gitlab, or forgejo'. I changed the refusal row to an invalid value (bitbucket) and updated the expected message in both rows. The fm-brief suite exits 0. The CI log excerpt did not name the failing script; I found this one by running the shard's scripts locally. tests/fm-test-run.test.sh still exits 1 in this sandbox (a comm sorted-order warning, then under LC_ALL=C a pty-host reparenting failure in fm-session-lock-ancestry, which this change does not touch). I believe that is environmental but have not confirmed it against unmodified main. I did not run the full CI shard or the full lint partition
…The only failed family was `secondmate`. I ran every serial-4 script that can be run here, and only `tests/fm-remote-reply.test.sh` failed. It is flaky: under 8 to 10 parallel runs it failed about once per batch with "a not-fully-applied capture lost its check-wake announcement". A debug copy showed that `start` never captured result 8, so the wake queue had no entry for it. The cause is a race in the test helper `await_reply_result`. It launches `fm-procevent.sh ensure-listening` in the background and never waits for it. That launcher could start a listener after `stop_reply_listener`, and that listener then held the source, so the later `start` captured nothing. The fix is in `tests/fm-remote-reply.test.sh`. The helper now waits for its background launcher before returning, on both the success and timeout paths. No assertion was changed or weakened. After the change, 12 parallel runs of the suite all passed. The invariant is that no helper-launched background process may outlive the call that started it and act on later test phases. `await_reply_result` was the only site that launched one without waiting. Not verified: I did not run the full CI shard. `fm-pi-branch-extension`, `fm-kimi-harness`, `fm-session-start`, `fm-task-delivery`, `fm-wake-drain-open-decisions-cursor` and the other long scripts in serial 4 were not run. I also did not confirm that `fm-remote-reply` was the script that failed in CI
0cdd811 to
fabc7ed
Compare
|
Speaking as Kun's firstmate: thanks @dimasmjunior. The new head's runs are approved: CI New head Contract-class: new-default (unchanged, my own read). Setting VISION.md (unchanged): One captain aligns. Authority explicit: tension, because the no-pipeline merge needs no flag and so it's Kun's call. Scripts own mechanics, restart, delegation, vendor and scope all align. Overlap FYI: #7462 (closes #7355) takes the other route to the same GitLab no-pipeline gap. It adds an attended-only Next step: waiting on CI, not on you. Once it's green, this goes to Kun to merge or leave, because of the default-behavior change. |
Require config/gitlab-support=1 for the bound-forge integration and its changes to existing URL-only operations. Preserve upstream tooling, authentication, diagnostics and legacy behavior when disabled. Require an attended --allow-no-pipeline flag for an explicitly absent pipeline and readable project policy permitting it. Keep present-pipeline status/SHA requirements and existing merge-authority settings unchanged. Cover disabled and enabled paths with behavioral regressions and document the home setting separately from the one-run waiver.
|
Before I spend time on a large rebase, one question: do you still want an opt-in The current head (ee4b204) answers the new-default concerns from the last triage. Everything GitLab-related sits behind The branch now conflicts with 19 files, because main rebuilt the poll and teardown paths after it was cut (#7858, #7965). #7243 proposes the same If the answer is yes, I'll rebase and drop the parts #7243 and main already cover. If you'd rather take #7243 alone, I'll close this one. |
Changes
Adds an optional GitLab project-delivery workflow using
glabfor hosted and self-hosted instances.Enable it in the chosen operational home, then register the project with
forge=gitlab:The setting follows the existing
FM_HOMEandFM_CONFIG_OVERRIDEdirectory selection and is disabled unless its value is1.A project binding or an existing merge waiver does not enable it.
GitLab-bound workers receive commands for creating a merge request, marking it ready and waiting on its pipeline.
The existing spawn and promotion checks enforce agreement between the registered binding and the worker's instructions.
Enabled homes can propose GitLab during project intake and check
glab,jqand each bound instance's authentication during bootstrap.The opt-in also enables additional GitLab draft/readiness checks, raw safety-field reads, synchronous ordinary merge submission, merged-state readback and MR head/content evidence during cleanup.
Uses the existing upstream waiver
This relies on the attended-only
--allow-no-pipelineflag and GitLab artifact-note handling already merged through #7462.Their implementations and tests remain upstream's; this adds no second waiver or artifact-note API.
Unopted waiver calls keep the existing upstream checks, arguments and submission outcomes.
When the home integration is enabled, its raw merge verification additionally corroborates readable boolean-false
only_allow_merge_if_pipeline_succeedsproject policy before applying that existing absence waiver.The home setting grants no waiver by itself.
Present pipelines still need to have succeeded at the current head, and the upstream flag's provider and attended-only restrictions remain intact.
Compatibility and scope
Homes without the setting retain the existing GitHub tool requirements and broad authentication probe, Gerrit detection evidence and startup messages.
Existing URL-only GitLab operations keep upstream behavior, including calls that explicitly select the upstream absence waiver.
Forge-aware bootstrap honors an explicit
GH_HOSTrather than redirecting it togithub.com.Delivery modes,
+yolo, Gerrit's publication and human-approval rules, and GitHub's named-base behavior are unchanged.Explicit GitLab bindings still refuse unsupported
--base-branchoverrides.The integration adds no MR media uploader, CI configuration, general watcher changes, automatic ready reconciliation or instance-specific configuration.
Current upstream main is merged without rewriting published commits.
Local verification
A tests-first regression rejects accidental activation of the home integration by the existing upstream waiver.
The landed waiver and artifact-note regressions remain, alongside opted-in draft, policy, outcome and cleanup coverage.
Local shell/workflow lint, documentation-audience checks and the portable coverage guard passed.
All 23 selected portable suites passed with unchanged assertions.
The host lacks
shasum, and unmodified current main fails at the same hash invocation; candidate tests used a development-onlyshasum -a 256frontend to nativesha256sum.Final owner lint and the complete replay suite also passed after quoting one test literal.
Thirty disabled-mode outputs matched an unmodified current-main export exactly, including exit status, stdout and stderr.
The comparisons include nine generated delivery contracts, registry/mode/branch-prefix behavior and original Gerrit detection evidence.
A committed-head CLI smoke passed all six scenario groups through the production Bash entrypoints with native
glab, Git,jqand a private tmux socket, including the unopted standalone upstream waiver.The GitLab API was a loopback fixture, not a deployed GitLab server; its runtime fixtures were removed without changing a real project or shared service.
Risk Assessment
Testing
I ran the prepared handoff harness against the worktree at ee4b204. It drives the real Bash entrypoints with native glab, git, jq and tmux in disposable marked homes, with the GitLab API served by a loopback fixture. All six groups passed, the fixture was removed afterwards, and the harness reported no writes to a shared daemon or real project. I used expected head ee4b204, the candidate under test, instead of the older ab7dbe78 from the earlier instruction. I did not run the portable suites or the rest of the repository tests.
Evidence: scenario results
Source: scenario results
Evidence: API exchanges
Source: API exchanges
Evidence: commands
Source: commands
Evidence: manifest
Source: manifest
Pipeline
Updates from git push no-mistakes
✅ **Intent** - passed
✅ No issues found.
✅ **Rebase** - passed
✅ No issues found.
✅ No issues found.
✅ **Test** - passed
✅ No issues found.
python3 gitlab-live-handoff.py --source <worktree> --expected-head ee4b204c2268d4edee6e94725adbd2edc5a143f5 --evidence <evidence>/gitlab-live-handoff --max-seconds 300✅ **Document** - passed
✅ No issues found.
✅ **Lint** - passed
✅ No issues found.
✅ **Push** - passed
✅ No issues found.