Repository navigation
srv1 lab follows main instead of a July session branch #13599
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
39 changes: 39 additions & 0 deletions
39
dag/test/claim/ci/deploy_sudoers_host_union_witness_test.dag
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,39 @@ | ||
| module test.claim.ci.deploy_sudoers_host_union_witness_test | ||
|
|
||
| import std.types { Bool, String, List } | ||
| import gunbc.ci_deploy_access { | ||
| DeployAccess, | ||
| ci_deploy_srv1_access, | ||
| ci_deploy_srv1_operator_access, | ||
| ci_deploy_srv1_operator_local_access, | ||
| deploy_accesses_on_host, | ||
| } | ||
| import gunbc.ci_deploy_sudoers { deploy_sudoers_dropin_body, deploy_sudoers_dropin_body_for } | ||
|
|
||
| // /etc/sudoers.d/gunbc-deploy IS HOST-SHARED (gunbc.ci_deploy_sudoers deploy_sudoers_dropin_body). | ||
| // The drop-in body is a function of the access alone -- no deployment row reaches it -- so the | ||
| // lab row and the production row render it identically by construction; what these claims pin is | ||
| // that every srv1 access renders the SAME bytes and that those bytes keep the CI runner's grants. | ||
| data ghrunner_systemctl_line: String = "ghrunner ALL=(ALL) NOPASSWD: /usr/bin/systemctl" | ||
|
|
||
| test fn every_srv1_access_renders_the_same_dropin_and_it_keeps_the_ci_runner_grants() -> Bool { | ||
| let local = deploy_sudoers_dropin_body(access: ci_deploy_srv1_operator_local_access) | ||
| local == deploy_sudoers_dropin_body(access: ci_deploy_srv1_access) | ||
| && local == deploy_sudoers_dropin_body(access: ci_deploy_srv1_operator_access) | ||
| && string_contains(s: local, pattern: ghrunner_systemctl_line) | ||
| && string_contains(s: local, pattern: "briansrls ALL=(ALL) NOPASSWD: /usr/bin/hostnamectl") | ||
| } | ||
|
|
||
| fn is_ci_runner_access(a: DeployAccess) -> Bool { | ||
| (a.principal.posix.name as String) == (ci_deploy_srv1_access.principal.posix.name as String) | ||
| } | ||
|
|
||
| // THE DISCRIMINATOR: the same body over the host roster with the CI principal removed loses the | ||
| // runner's lines. This is the drop-in the operator-local apply used to install. | ||
| test fn removing_the_ci_principal_from_the_union_drops_its_grants() -> Bool { | ||
| let without_ci = filter( | ||
| xs: deploy_accesses_on_host(host: ci_deploy_srv1_access.host), | ||
| predicate: a => !is_ci_runner_access(a: a), | ||
| ) | ||
| !string_contains(s: deploy_sudoers_dropin_body_for(accesses: without_ci), pattern: ghrunner_systemctl_line) | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
When the controller worktree is non-shallow and its
origin/mainhas not recently been fetched, this points the lab at a stale local remote-tracking ref rather than the current main branch. Preflight captures that stale SHA, anddashboard_hydrate_controller_historyexplicitly performs no fetch for non-shallow repositories, so the apply bundles the cached commit and can report the lab converged while still serving outdated content. Fetch the modeled remote before resolving/bundling this ref, or otherwise ensure the anchor is refreshed as part of apply.Useful? React with 👍 / 👎.