mirror of
https://github.com/firestar5683/StarPilot.git
synced 2026-12-02 18:13:41 +08:00
Use Stable and Testing channels in legacy Galaxy and build tools
This commit is contained in:
@@ -0,0 +1,30 @@
|
||||
name: Legacy channel migration contracts
|
||||
|
||||
on:
|
||||
push:
|
||||
branches: [StarPilot, stable, review/nov17-stable-channel-config]
|
||||
pull_request:
|
||||
paths:
|
||||
- 'scripts/branch_migration.py'
|
||||
- 'scripts/tests/test_stable_workflows.mjs'
|
||||
- '.github/workflows/**'
|
||||
- 'starpilot/system/the_galaxy/assets/mobile/js/views/SystemTools.js'
|
||||
- 'starpilot/system/the_galaxy/tests/test_branch_selector.mjs'
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
||||
jobs:
|
||||
contracts:
|
||||
name: Legacy channel migration contracts
|
||||
runs-on: ubuntu-24.04
|
||||
timeout-minutes: 10
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: actions/setup-node@v4
|
||||
with:
|
||||
node-version: '22'
|
||||
- run: node starpilot/system/the_galaxy/tests/test_branch_selector.mjs "$PWD"
|
||||
- run: node scripts/tests/test_stable_workflows.mjs "$PWD"
|
||||
- run: python3 -m unittest discover -s scripts/tests -p test_stable_build_targets.py -v
|
||||
@@ -82,6 +82,12 @@ jobs:
|
||||
echo "BUILD_BRANCH=${TARGET_REF}" >> "$GITHUB_ENV"
|
||||
fi
|
||||
|
||||
branch="${TARGET_REF#refs/heads/}"
|
||||
git check-ref-format --branch "$branch"
|
||||
case "$branch" in
|
||||
Dom|StarPilot) echo "Compatibility bridges cannot receive build commits." >&2; exit 1 ;;
|
||||
esac
|
||||
|
||||
- name: Checkout target branch
|
||||
uses: actions/checkout@v6
|
||||
with:
|
||||
|
||||
@@ -6,7 +6,7 @@ on:
|
||||
target_ref:
|
||||
description: "Branch to build and publish back to"
|
||||
type: string
|
||||
default: "master"
|
||||
default: "stable"
|
||||
required: true
|
||||
jobs:
|
||||
description: "Optional parallel job count passed to ./build"
|
||||
@@ -47,6 +47,12 @@ jobs:
|
||||
echo "BUILD_BRANCH=${TARGET_REF}" >> "$GITHUB_ENV"
|
||||
fi
|
||||
|
||||
branch="${TARGET_REF#refs/heads/}"
|
||||
git check-ref-format --branch "$branch"
|
||||
case "$branch" in
|
||||
Dom|StarPilot) echo "Compatibility bridges cannot receive build commits." >&2; exit 1 ;;
|
||||
esac
|
||||
|
||||
- name: Checkout target branch
|
||||
uses: actions/checkout@v6
|
||||
with:
|
||||
|
||||
@@ -0,0 +1,21 @@
|
||||
name: Testing docs (manual)
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
actions: write
|
||||
|
||||
jobs:
|
||||
dispatch:
|
||||
name: Queue Testing qualification
|
||||
runs-on: ubuntu-24.04
|
||||
timeout-minutes: 5
|
||||
steps:
|
||||
- uses: actions/github-script@v7
|
||||
with:
|
||||
script: |
|
||||
const branch = await github.rest.repos.getBranch({...context.repo, branch: 'testing'});
|
||||
await github.rest.actions.createWorkflowDispatch({...context.repo, workflow_id: 'docs.yaml', ref: 'testing'});
|
||||
core.notice('Queued docs.yaml on Testing (observed head ' + branch.data.commit.sha + '). Check that workflow for qualification results; this job only dispatches it.');
|
||||
@@ -0,0 +1,21 @@
|
||||
name: Testing flm-offroad (manual)
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
actions: write
|
||||
|
||||
jobs:
|
||||
dispatch:
|
||||
name: Queue Testing qualification
|
||||
runs-on: ubuntu-24.04
|
||||
timeout-minutes: 5
|
||||
steps:
|
||||
- uses: actions/github-script@v7
|
||||
with:
|
||||
script: |
|
||||
const branch = await github.rest.repos.getBranch({...context.repo, branch: 'testing'});
|
||||
await github.rest.actions.createWorkflowDispatch({...context.repo, workflow_id: 'flm-offroad.yaml', ref: 'testing'});
|
||||
core.notice('Queued flm-offroad.yaml on Testing (observed head ' + branch.data.commit.sha + '). Check that workflow for qualification results; this job only dispatches it.');
|
||||
@@ -0,0 +1,21 @@
|
||||
name: Testing galaxy-phone-bridge (manual)
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
actions: write
|
||||
|
||||
jobs:
|
||||
dispatch:
|
||||
name: Queue Testing qualification
|
||||
runs-on: ubuntu-24.04
|
||||
timeout-minutes: 5
|
||||
steps:
|
||||
- uses: actions/github-script@v7
|
||||
with:
|
||||
script: |
|
||||
const branch = await github.rest.repos.getBranch({...context.repo, branch: 'testing'});
|
||||
await github.rest.actions.createWorkflowDispatch({...context.repo, workflow_id: 'galaxy-phone-bridge.yaml', ref: 'testing'});
|
||||
core.notice('Queued galaxy-phone-bridge.yaml on Testing (observed head ' + branch.data.commit.sha + '). Check that workflow for qualification results; this job only dispatches it.');
|
||||
@@ -0,0 +1,21 @@
|
||||
name: Testing safety (manual)
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
actions: write
|
||||
|
||||
jobs:
|
||||
dispatch:
|
||||
name: Queue Testing qualification
|
||||
runs-on: ubuntu-24.04
|
||||
timeout-minutes: 5
|
||||
steps:
|
||||
- uses: actions/github-script@v7
|
||||
with:
|
||||
script: |
|
||||
const branch = await github.rest.repos.getBranch({...context.repo, branch: 'testing'});
|
||||
await github.rest.actions.createWorkflowDispatch({...context.repo, workflow_id: 'safety.yaml', ref: 'testing'});
|
||||
core.notice('Queued safety.yaml on Testing (observed head ' + branch.data.commit.sha + '). Check that workflow for qualification results; this job only dispatches it.');
|
||||
@@ -0,0 +1,21 @@
|
||||
name: Testing simulator-driving (manual)
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
actions: write
|
||||
|
||||
jobs:
|
||||
dispatch:
|
||||
name: Queue Testing qualification
|
||||
runs-on: ubuntu-24.04
|
||||
timeout-minutes: 5
|
||||
steps:
|
||||
- uses: actions/github-script@v7
|
||||
with:
|
||||
script: |
|
||||
const branch = await github.rest.repos.getBranch({...context.repo, branch: 'testing'});
|
||||
await github.rest.actions.createWorkflowDispatch({...context.repo, workflow_id: 'simulator-driving.yaml', ref: 'testing'});
|
||||
core.notice('Queued simulator-driving.yaml on Testing (observed head ' + branch.data.commit.sha + '). Check that workflow for qualification results; this job only dispatches it.');
|
||||
@@ -0,0 +1,21 @@
|
||||
name: Testing tests (manual)
|
||||
|
||||
on:
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
actions: write
|
||||
|
||||
jobs:
|
||||
dispatch:
|
||||
name: Queue Testing qualification
|
||||
runs-on: ubuntu-24.04
|
||||
timeout-minutes: 5
|
||||
steps:
|
||||
- uses: actions/github-script@v7
|
||||
with:
|
||||
script: |
|
||||
const branch = await github.rest.repos.getBranch({...context.repo, branch: 'testing'});
|
||||
await github.rest.actions.createWorkflowDispatch({...context.repo, workflow_id: 'tests.yaml', ref: 'testing'});
|
||||
core.notice('Queued tests.yaml on Testing (observed head ' + branch.data.commit.sha + '). Check that workflow for qualification results; this job only dispatches it.');
|
||||
@@ -0,0 +1,37 @@
|
||||
from pathlib import Path
|
||||
import os
|
||||
import subprocess
|
||||
import tempfile
|
||||
import unittest
|
||||
|
||||
ROOT = Path(__file__).resolve().parents[2]
|
||||
|
||||
|
||||
class BuildTargetsTest(unittest.TestCase):
|
||||
def test_build_targets_reject_bridge_and_invalid_refs(self):
|
||||
for workflow in ('compile_starpilot.yaml', 'compile_bluescreens.yaml'):
|
||||
source = (ROOT / '.github/workflows' / workflow).read_text()
|
||||
guard = source.split(' branch="${TARGET_REF#refs/heads/}"', 1)[1].split('\n - ', 1)[0]
|
||||
script = 'set -eu\nbranch="${TARGET_REF#refs/heads/}"\n' + '\n'.join(line[10:] if line.startswith(' ') else line for line in guard.splitlines())
|
||||
with tempfile.TemporaryDirectory() as temporary:
|
||||
for target in ('stable', 'testing', 'bluescreensonly2', 'refs/heads/stable'):
|
||||
with self.subTest(workflow=workflow, target=target):
|
||||
result = subprocess.run(['bash', '-c', script], cwd=temporary, env={**os.environ, 'TARGET_REF': target}, capture_output=True)
|
||||
self.assertEqual(result.returncode, 0, result.stderr)
|
||||
for target in ('Dom', 'StarPilot', 'refs/heads/Dom', 'refs/heads/StarPilot', '-bad', 'feature\nBUILD_BRANCH=Dom', 'HEAD', 'refs/heads/../../Dom'):
|
||||
with self.subTest(workflow=workflow, target=target):
|
||||
result = subprocess.run(['bash', '-c', script], cwd=temporary, env={**os.environ, 'TARGET_REF': target}, capture_output=True)
|
||||
self.assertNotEqual(result.returncode, 0)
|
||||
|
||||
def test_default_stable_and_source_only_fleet_gate(self):
|
||||
compile_workflow = (ROOT / '.github/workflows/compile_starpilot.yaml').read_text()
|
||||
self.assertIn('default: "stable"', compile_workflow)
|
||||
self.assertIn('git push origin "HEAD:refs/heads/${BUILD_BRANCH}"', compile_workflow)
|
||||
self.assertNotIn('--force', compile_workflow)
|
||||
fleet = (ROOT / '.github/workflows/fleet_safety.yaml').read_text()
|
||||
self.assertIn('python -m selfdrive.car.tests.fleet_safety --all --release', fleet)
|
||||
self.assertNotIn('openpilot/selfdrive/', fleet)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
unittest.main()
|
||||
@@ -0,0 +1,32 @@
|
||||
import fs from 'node:fs'
|
||||
import vm from 'node:vm'
|
||||
import assert from 'node:assert/strict'
|
||||
import test from 'node:test'
|
||||
const root = process.argv[2] || new URL('../', import.meta.url).pathname
|
||||
const workflows = ['tests.yaml', 'safety.yaml', 'docs.yaml', 'flm-offroad.yaml', 'galaxy-phone-bridge.yaml', 'simulator-driving.yaml']
|
||||
for (const workflow of workflows) {
|
||||
const source = fs.readFileSync(root + '/.github/workflows/' + workflow, 'utf8')
|
||||
const script = source.split(' script: |\n')[1].split('\n').map(line => line.slice(12)).join('\n')
|
||||
test(workflow + ' dispatches only the genuine Testing workflow without claiming qualification', async () => {
|
||||
const calls = [], notices = []
|
||||
const context = {repo: {owner: 'StarPilotHQ', repo: 'StarPilot'}}
|
||||
const github = {rest: {
|
||||
repos: {getBranch: async args => {calls.push(['branch', args]); return {data: {commit: {sha: 'a'.repeat(40)}}}}},
|
||||
actions: {createWorkflowDispatch: async args => {calls.push(['dispatch', args])}},
|
||||
}}
|
||||
await vm.runInNewContext('(async () => {' + script + '})()', {github, context, core: {notice: message => notices.push(message)}})
|
||||
assert.deepEqual(JSON.parse(JSON.stringify(calls)), [
|
||||
['branch', {...context.repo, branch: 'testing'}],
|
||||
['dispatch', {...context.repo, workflow_id: workflow, ref: 'testing'}],
|
||||
])
|
||||
assert.match(notices[0], /this job only dispatches/)
|
||||
assert.match(source, /actions: write/)
|
||||
assert.doesNotMatch(source, /contents: write|schedule:|pull_request:|\bpush:/)
|
||||
})
|
||||
test(workflow + ' fails before dispatch if Testing is unavailable', async () => {
|
||||
let dispatched = false
|
||||
const github = {rest: {repos: {getBranch: async () => {throw Error('missing Testing')}}, actions: {createWorkflowDispatch: async () => {dispatched = true}}}}
|
||||
await assert.rejects(vm.runInNewContext('(async () => {' + script + '})()', {github, context: {repo: {}}, core: {notice() {}}}), /missing Testing/)
|
||||
assert.equal(dispatched, false)
|
||||
})
|
||||
}
|
||||
@@ -60,7 +60,7 @@ function githubCommitsUrl(remote, commitsUrl, branch) {
|
||||
return `${base}/commits/${encodeURIComponent(normalizedBranch)}/`
|
||||
}
|
||||
|
||||
const CORE_UPDATE_BRANCHES = ["StarPilot", "Dom"]
|
||||
const CORE_UPDATE_BRANCHES = ["stable", "testing"]
|
||||
const REBOOT_PENDING_STORAGE_KEY = "galaxy-update-reboot-pending"
|
||||
const LOCAL_DEVICE_SCOPE = "local"
|
||||
const DEVICE_SLUG_RE = /^[A-Za-z0-9]{16}$/
|
||||
@@ -177,11 +177,11 @@ export const SystemTools = {
|
||||
computed: {
|
||||
primaryBranchValue() {
|
||||
if (this.otherBranchesOpen) return "other:"
|
||||
return ["StarPilot", "Dom"].includes(this.targetBranch) ? this.targetBranch : ""
|
||||
return CORE_UPDATE_BRANCHES.includes(this.targetBranch) ? this.targetBranch : ""
|
||||
},
|
||||
otherBranches() {
|
||||
const branches = this.branches.filter(branch => !["StarPilot", "Dom"].includes(branch))
|
||||
if (this.currentBranch && !["StarPilot", "Dom"].includes(this.currentBranch) && !branches.includes(this.currentBranch)) {
|
||||
const branches = this.branches.filter(branch => !CORE_UPDATE_BRANCHES.includes(branch))
|
||||
if (this.currentBranch && !CORE_UPDATE_BRANCHES.includes(this.currentBranch) && !branches.includes(this.currentBranch)) {
|
||||
branches.unshift(this.currentBranch)
|
||||
}
|
||||
return branches
|
||||
@@ -200,7 +200,7 @@ export const SystemTools = {
|
||||
},
|
||||
updateInProgress() { return !!this.fastStatus?.running || this.statusRebooting || this.rebootPending },
|
||||
statusPollingNeeded() { return this.statusUnavailable || !this.fastStatus || this.updateInProgress || this.rebootPending },
|
||||
versionChoices() { return this.targetBranch === "StarPilot" ? releaseVersions(this.versionCommits) : this.versionCommits },
|
||||
versionChoices() { return ["StarPilot", "stable"].includes(this.targetBranch) ? releaseVersions(this.versionCommits) : this.versionCommits },
|
||||
installVersionBlocked() {
|
||||
return this.branchSwitchBlocked || this.branchBusy || !this.branches.includes(this.targetBranch) ||
|
||||
(this.versionMode === "earlier" && (this.versionLoading || !/^[a-f0-9]{40}$/.test(this.selectedCommit) || !this.versionChoices.some(commit => commit.sha === this.selectedCommit)))
|
||||
@@ -238,7 +238,7 @@ export const SystemTools = {
|
||||
this.branchListError = ""
|
||||
if (!this.targetBranch) {
|
||||
this.targetBranch = this.currentBranch
|
||||
this.otherBranchesOpen = !!this.targetBranch && !["StarPilot", "Dom"].includes(this.targetBranch)
|
||||
this.otherBranchesOpen = !!this.targetBranch && !CORE_UPDATE_BRANCHES.includes(this.targetBranch)
|
||||
}
|
||||
this.isOnroad = !!data?.isOnroad
|
||||
} catch (e) {
|
||||
@@ -253,7 +253,7 @@ export const SystemTools = {
|
||||
this.branches = [...new Set([current, ...CORE_UPDATE_BRANCHES].filter(Boolean))]
|
||||
this.branchListFallback = true
|
||||
if (!this.targetBranch) {
|
||||
this.targetBranch = current || "Dom"
|
||||
this.targetBranch = current || "stable"
|
||||
this.otherBranchesOpen = !!this.targetBranch && !CORE_UPDATE_BRANCHES.includes(this.targetBranch)
|
||||
}
|
||||
showSnackbar("Could not refresh the full branch list. Standard branches are still available.", "error")
|
||||
@@ -397,7 +397,7 @@ export const SystemTools = {
|
||||
if (!branch || !this.branches.includes(branch) || this.branchBusy || this.branchSwitchBlocked) return
|
||||
if (branch === this.targetBranch) return
|
||||
this.targetBranch = branch
|
||||
this.otherBranchesOpen = !["StarPilot", "Dom"].includes(branch)
|
||||
this.otherBranchesOpen = !CORE_UPDATE_BRANCHES.includes(branch)
|
||||
this.resetVersions()
|
||||
},
|
||||
resetVersions() {
|
||||
@@ -433,7 +433,7 @@ export const SystemTools = {
|
||||
this.versionLoading = true
|
||||
this.versionError = ""
|
||||
const originalCount = this.versionChoices.length
|
||||
const budget = more && branch === "StarPilot" ? 4 : 1
|
||||
const budget = more && ["StarPilot", "stable"].includes(branch) ? 4 : 1
|
||||
try {
|
||||
for (let scanned = 0; scanned < budget; scanned++) {
|
||||
const data = await api.getUpdateVersions(branch, {page, head, signal: controller.signal})
|
||||
@@ -483,7 +483,7 @@ export const SystemTools = {
|
||||
this.branchBusy = true
|
||||
try {
|
||||
const selected = this.versionCommits.find(item => item.sha === commit)
|
||||
const version = commit === "latest" ? "Latest" : `${versionTitle(selected, branch === "StarPilot")}\nCommit: ${commit}`
|
||||
const version = commit === "latest" ? "Latest" : `${versionTitle(selected, ["StarPilot", "stable"].includes(branch))}\nCommit: ${commit}`
|
||||
const policy = commit === "latest" ? "This uses the normal branch updater, including any required OS update during startup. Your automatic-update setting is unchanged." : "Automatic updates will be paused for this earlier version."
|
||||
const recovery = commit === "latest"
|
||||
? "This replaces the current software. Settings and statistics are kept. Local code changes may be overwritten; standard Rollback saves the previous committed version."
|
||||
@@ -724,8 +724,8 @@ export const SystemTools = {
|
||||
<GalaxySelect id="gx-primary-branch" class="gx-field gx-field--full" aria-label="Target branch"
|
||||
:value="primaryBranchValue" :disabled="branchSwitchBlocked || branchBusy" @change="onPrimaryBranchSelect">
|
||||
<option value="" disabled>Select a branch</option>
|
||||
<option value="StarPilot" data-collapsed-label="StarPilot" data-description="Stable releases. Recommended for most users.">StarPilot — Release</option>
|
||||
<option value="Dom" data-collapsed-label="Dom" data-description="Latest features and fixes under development. Updates regularly and may introduce bugs.">Dom — Development</option>
|
||||
<option value="stable" data-collapsed-label="Stable" data-description="Stable releases. Recommended for most users.">Stable — Release</option>
|
||||
<option value="testing" data-collapsed-label="Testing" data-description="Latest features and fixes under development. Updates regularly and may introduce bugs.">Testing — Development</option>
|
||||
<option value="other:">Other branches…</option>
|
||||
</GalaxySelect>
|
||||
<div v-if="otherBranchesOpen" style="margin-top:var(--sp-3); padding-left:var(--sp-3); border-left:2px solid var(--outline-variant);">
|
||||
@@ -747,7 +747,7 @@ export const SystemTools = {
|
||||
</GalaxySelect>
|
||||
<template v-if="versionMode === 'earlier'">
|
||||
<VersionHistoryPicker id="gx-version-commit" :value="selectedCommit" :commits="versionCommits"
|
||||
:release-branch="targetBranch === 'StarPilot'" :loading="versionLoading" :has-more="versionHasMore" :error="versionError" :notice="versionNotice"
|
||||
:release-branch="['StarPilot', 'stable'].includes(targetBranch)" :loading="versionLoading" :has-more="versionHasMore" :error="versionError" :notice="versionNotice"
|
||||
:disabled="branchSwitchBlocked || branchBusy" @change="selectedCommit = $event.target.value"
|
||||
@loadmore="loadVersions(versionCommits.length > 0 && versionHasMore)" />
|
||||
</template>
|
||||
|
||||
@@ -19,7 +19,7 @@ function fixture() {
|
||||
vm.runInContext(fs.readFileSync(js + 'components/VersionHistoryPicker.js', 'utf8').replace(/export /g, ''), context)
|
||||
vm.runInContext(source.replace(/^import .*$/gm, '').replace('export const SystemTools =', 'globalThis.component ='), context)
|
||||
const component = context.component
|
||||
const instance = {...component.data(), ...component.methods, branches: ['Dom', 'SunnyPilot', 'StarPilot', 'feature/test'], currentBranch: 'feature/local', branchLoading: false}
|
||||
const instance = {...component.data(), ...component.methods, branches: ['stable', 'testing', 'Dom', 'SunnyPilot', 'StarPilot', 'feature/test'], currentBranch: 'feature/local', branchLoading: false}
|
||||
for (const [key, getter] of Object.entries(component.computed)) Object.defineProperty(instance, key, {get: () => getter.call(instance)})
|
||||
return {instance, calls, confirmations, messages, reads, api, setConfirm: fn => {confirm = fn}}
|
||||
}
|
||||
@@ -37,10 +37,10 @@ test('primary and Other choices stage a target without installing or confirming'
|
||||
})
|
||||
test('current custom branch remains visible when absent from remote', () => {
|
||||
const {instance} = fixture()
|
||||
assert.deepEqual(Array.from(instance.otherBranches), ['feature/local', 'SunnyPilot', 'feature/test'])
|
||||
assert.deepEqual(Array.from(instance.otherBranches), ['feature/local', 'Dom', 'SunnyPilot', 'StarPilot', 'feature/test'])
|
||||
})
|
||||
test('every remote branch can install latest only through explicit confirmation', async () => {
|
||||
for (const branch of ['StarPilot', 'Dom', 'SunnyPilot', 'feature/test']) {
|
||||
for (const branch of ['stable', 'testing', 'StarPilot', 'Dom', 'SunnyPilot', 'feature/test']) {
|
||||
const {instance, calls, confirmations} = fixture()
|
||||
instance.selectTargetBranch(branch)
|
||||
await instance.installSelectedVersion()
|
||||
@@ -290,3 +290,42 @@ test('Latest explains normal OS handling and local-edit behavior; historical con
|
||||
assert.match(confirmations[1].message, /updates will be paused/)
|
||||
assert.match(confirmations[1].message, /code changes are backed up/)
|
||||
})
|
||||
|
||||
|
||||
test('Stable and Testing are the primary choices; old aliases stay under Other', () => {
|
||||
const {instance} = fixture()
|
||||
assert.match(source, /<option value="stable"/)
|
||||
assert.match(source, /<option value="testing"/)
|
||||
assert.doesNotMatch(source, /<option value="Dom"|<option value="StarPilot"/)
|
||||
for (const branch of ['stable', 'testing']) {
|
||||
instance.selectTargetBranch(branch)
|
||||
assert.equal(instance.primaryBranchValue, branch)
|
||||
assert.equal(instance.otherBranchesOpen, false)
|
||||
assert.ok(!instance.otherBranches.includes(branch))
|
||||
}
|
||||
instance.selectTargetBranch('Dom')
|
||||
assert.equal(instance.primaryBranchValue, 'other:')
|
||||
assert.ok(instance.otherBranches.includes('Dom'))
|
||||
})
|
||||
test('Stable history keeps release deduplication and normal confirmation', async () => {
|
||||
const {instance, api, calls} = fixture()
|
||||
api.getUpdateVersions = async (branch, {page}) => ({branch, head: HEAD, page, hasMore: false, commits: [
|
||||
{sha: SHA, version: '6.7.9', subject: 'Latest build'},
|
||||
{sha: 'c'.repeat(40), version: '6.7.9', subject: 'Earlier build'},
|
||||
]})
|
||||
instance.selectTargetBranch('stable')
|
||||
await instance.onVersionModeSelect({target: {value: 'earlier'}})
|
||||
assert.equal(instance.versionChoices.length, 1)
|
||||
instance.selectedCommit = SHA
|
||||
await instance.installSelectedVersion()
|
||||
assert.deepEqual(calls, [{branch: 'stable', commit: SHA}])
|
||||
})
|
||||
test('Offline branch-list fallback offers the canonical channels without installing', async () => {
|
||||
const {instance, api, calls} = fixture()
|
||||
api.getUpdateBranches = async () => {throw Error('offline')}
|
||||
instance.currentBranch = ''
|
||||
await instance.loadBranches()
|
||||
assert.deepEqual(Array.from(instance.branches), ['stable', 'testing'])
|
||||
assert.equal(instance.targetBranch, 'stable')
|
||||
assert.deepEqual(calls, [])
|
||||
})
|
||||
|
||||
@@ -8345,9 +8345,9 @@ def setup(app):
|
||||
build_metadata = get_build_metadata()
|
||||
|
||||
short_branch = build_metadata.channel
|
||||
if short_branch == "StarPilot":
|
||||
if short_branch in ("StarPilot", "stable"):
|
||||
galaxy_label = "Stable"
|
||||
elif short_branch == "Dom":
|
||||
elif short_branch in ("Dom", "testing"):
|
||||
galaxy_label = "Testing"
|
||||
else:
|
||||
galaxy_label = "Experimental"
|
||||
|
||||
Reference in New Issue
Block a user