Repository navigation
ci(nightly): admit Linux controls on fleet before paid overflow #30085
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
Merged
teamleaderleo
merged 9 commits into
feat-cmux-next
from
lane/nightly-linux-control-admission
Nov 1, 2026
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
c5d4373
test(ci): require nightly controls to consume fleet admission receipts
teamleaderleo 9717dca
ci(nightly): consume reserved fleet leases before Linux overflow
teamleaderleo 1b762bf
fix(ci): retain committed fleet admission through response delay
teamleaderleo 872c6a0
test(ci): reject unauthenticated receipts and preserve nightly tracks
teamleaderleo 5e040ed
ci: authenticate fleet admission over HTTPS or active Tailscale peer
teamleaderleo 9e3ed62
ci(nightly): bind fleet admission to its track and authenticated receipt
teamleaderleo 07793db
ci: bootstrap Rust before generating nightly notices
teamleaderleo ec0df76
ci(nightly): leave signer routing to its dedicated lane
teamleaderleo 8ed7063
Merge current NEXT routing while retaining verified Linux admission
teamleaderleo 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,66 @@ | ||
| """Read fleet admission from its configured authenticated transport. | ||
|
|
||
| The existing controller uses HTTP over Tailscale. Accept that only for a | ||
| numeric address belonging to an online peer of the running local Tailscale | ||
| daemon. The encrypted peer connection is the existing authority; no bearer | ||
| secret or new runner trust is introduced. HTTPS uses normal certificate and | ||
| hostname verification. Neither path follows redirects or environment proxies. | ||
| """ | ||
| from __future__ import annotations | ||
|
|
||
| import ipaddress | ||
| import json | ||
| import shutil | ||
| import subprocess | ||
| import urllib.parse | ||
| import urllib.request | ||
| from pathlib import Path | ||
| from typing import Any, Mapping | ||
|
|
||
|
|
||
| class NoRedirect(urllib.request.HTTPRedirectHandler): | ||
| def redirect_request(self, req, fp, code, msg, headers, newurl): | ||
| raise ValueError("fleet admission must not redirect its authority") | ||
|
|
||
|
|
||
| def verify_authority(url: str) -> None: | ||
| parsed = urllib.parse.urlsplit(url) | ||
| if not parsed.hostname or parsed.username or parsed.password or parsed.fragment: | ||
| raise ValueError("invalid fleet admission authority") | ||
| if parsed.scheme == "https": | ||
| return | ||
| if parsed.scheme != "http": | ||
| raise ValueError("fleet admission needs HTTPS or the existing Tailscale transport") | ||
| try: | ||
| address = ipaddress.ip_address(parsed.hostname) | ||
| except ValueError as error: | ||
| raise ValueError("HTTP fleet admission needs a numeric Tailscale peer address") from error | ||
| if not (address in ipaddress.ip_network("100.64.0.0/10") | ||
| or address in ipaddress.ip_network("fd7a:115c:a1e0::/48")): | ||
| raise ValueError("plain HTTP fleet admission is outside Tailscale") | ||
| executable = shutil.which("tailscale") | ||
| if executable is None: | ||
| app = Path("/Applications/Tailscale.app/Contents/MacOS/Tailscale") | ||
| executable = str(app) if app.is_file() else None | ||
| if executable is None: | ||
| raise ValueError("cannot authenticate the controller's Tailscale peer") | ||
| result = subprocess.run([executable, "status", "--json"], check=True, | ||
| capture_output=True, text=True, timeout=5) | ||
| status = json.loads(result.stdout) | ||
| peers = status.get("Peer") or {} | ||
| if status.get("BackendState") != "Running" or not any( | ||
| peer.get("Online") is True and str(address) in (peer.get("TailscaleIPs") or []) | ||
| for peer in peers.values()): | ||
| raise ValueError("controller is not an online authenticated Tailscale peer") | ||
|
|
||
|
|
||
| def exchange(url: str, payload: Mapping[str, Any] | None = None) -> dict[str, Any]: | ||
| verify_authority(url) | ||
| data = json.dumps(payload).encode() if payload is not None else None | ||
| request = urllib.request.Request(url, data=data, headers={"Content-Type": "application/json"}) | ||
| opener = urllib.request.build_opener(urllib.request.ProxyHandler({}), NoRedirect()) | ||
| with opener.open(request, timeout=35) as response: | ||
| value = json.load(response) | ||
| if not isinstance(value, dict): | ||
| raise ValueError("admission response must be an object") | ||
| return value |
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.
P2: The admission test shares a
runstep with the placement test, so a placement-test failure exits the shell before the admission test runs. Give it a separate!cancelled()step so both guard failures are reported.Prompt for AI agents