mirror of
https://github.com/BerriAI/litellm.git
synced 2026-09-26 01:12:21 +00:00
chore(ci): drop litellm_internal_staging and litellm_oss_staging references, main is the only trunk (#42745)
This commit is contained in:
parent
75a6bca8b9
commit
48050d9646
35 changed files with 30 additions and 137 deletions
|
|
@ -3222,7 +3222,7 @@ workflows:
|
|||
cron: "17 0,6,12,18 * * *"
|
||||
filters:
|
||||
branches:
|
||||
only: litellm_internal_staging
|
||||
only: main
|
||||
jobs: *migration_jobs
|
||||
integration:
|
||||
unless: << pipeline.parameters.run_migration_tests >>
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ run_full() {
|
|||
|
||||
[ -n "${CIRCLE_PULL_REQUEST:-}" ] || run_full "not a pull request"
|
||||
|
||||
candidate_bases="main litellm_internal_staging litellm_oss_staging"
|
||||
candidate_bases="main"
|
||||
merge_base=""
|
||||
for base in $candidate_bases; do
|
||||
git fetch --quiet origin "$base" 2>/dev/null || continue
|
||||
|
|
|
|||
|
|
@ -8,7 +8,6 @@
|
|||
#
|
||||
# Protected branches (always allowed):
|
||||
# - main
|
||||
# - litellm_internal_staging
|
||||
# - dependabot/*
|
||||
# - gh-readonly-queue/*
|
||||
#
|
||||
|
|
@ -22,7 +21,7 @@ ZERO_OID_SHA256="000000000000000000000000000000000000000000000000000000000000000
|
|||
ALLOWED_TYPES="feature|bugfix|hotfix|release|chore"
|
||||
BRANCH_PATTERN="^(${ALLOWED_TYPES})/.+"
|
||||
|
||||
PROTECTED_NAMES="main litellm_internal_staging"
|
||||
PROTECTED_NAMES="main"
|
||||
PROTECTED_PREFIXES="dependabot/ gh-readonly-queue/"
|
||||
|
||||
is_protected() {
|
||||
|
|
@ -78,8 +77,7 @@ if [ -n "$invalid" ]; then
|
|||
chore/bump-deps
|
||||
hotfix/auth-bypass
|
||||
|
||||
Protected (always allowed): main, litellm_internal_staging,
|
||||
dependabot/*, gh-readonly-queue/*.
|
||||
Protected (always allowed): main, dependabot/*, gh-readonly-queue/*.
|
||||
|
||||
See https://conventional-branch.github.io/
|
||||
|
||||
|
|
|
|||
2
.github/workflows/check-ui-api-types.yml
vendored
2
.github/workflows/check-ui-api-types.yml
vendored
|
|
@ -4,8 +4,6 @@ on:
|
|||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
- litellm_internal_staging
|
||||
- litellm_oss_staging
|
||||
- "litellm_**"
|
||||
|
||||
permissions:
|
||||
|
|
|
|||
3
.github/workflows/ci-coverage.yml
vendored
3
.github/workflows/ci-coverage.yml
vendored
|
|
@ -4,13 +4,10 @@ on:
|
|||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
- litellm_internal_staging
|
||||
- litellm_oss_staging
|
||||
- "litellm_**"
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- litellm_internal_staging
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
|
|
|||
2
.github/workflows/codspeed.yml
vendored
2
.github/workflows/codspeed.yml
vendored
|
|
@ -4,7 +4,6 @@ on:
|
|||
push:
|
||||
branches:
|
||||
- main
|
||||
- litellm_internal_staging
|
||||
paths:
|
||||
- "litellm/**"
|
||||
- "tests/benchmarks/**"
|
||||
|
|
@ -17,7 +16,6 @@ on:
|
|||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
- litellm_internal_staging
|
||||
paths:
|
||||
- "litellm/**"
|
||||
- "tests/benchmarks/**"
|
||||
|
|
|
|||
2
.github/workflows/cost-map-guard.yml
vendored
2
.github/workflows/cost-map-guard.yml
vendored
|
|
@ -4,8 +4,6 @@ on: # zizmor: ignore[dangerous-triggers] runs the base branch's code only; the P
|
|||
pull_request_target:
|
||||
branches:
|
||||
- main
|
||||
- litellm_internal_staging
|
||||
- litellm_oss_staging
|
||||
- "litellm_**"
|
||||
|
||||
permissions:
|
||||
|
|
|
|||
|
|
@ -1,49 +0,0 @@
|
|||
name: Create Daily Staging Branch
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: "0 0,12 * * *" # Runs every 12 hours at midnight and noon UTC
|
||||
workflow_dispatch: # Allow manual trigger
|
||||
|
||||
jobs:
|
||||
create-staging-branch:
|
||||
if: github.repository == 'BerriAI/litellm'
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
steps:
|
||||
- name: Create daily staging branch
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
BRANCH_NAME="litellm_oss_staging_$(date +'%m_%d_%Y')"
|
||||
echo "Creating branch: $BRANCH_NAME"
|
||||
if gh api "repos/${{ github.repository }}/git/ref/heads/$BRANCH_NAME" --silent 2>/dev/null; then
|
||||
echo "Branch $BRANCH_NAME already exists. Skipping creation."
|
||||
exit 0
|
||||
fi
|
||||
MAIN_SHA=$(gh api "repos/${{ github.repository }}/git/ref/heads/main" --jq '.object.sha')
|
||||
gh api "repos/${{ github.repository }}/git/refs" -f ref="refs/heads/$BRANCH_NAME" -f sha="$MAIN_SHA" --silent
|
||||
echo "Successfully created branch: $BRANCH_NAME at $MAIN_SHA"
|
||||
|
||||
create-internal-dev-branch:
|
||||
if: github.repository == 'BerriAI/litellm'
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: write
|
||||
|
||||
steps:
|
||||
- name: Create internal dev branch
|
||||
env:
|
||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
run: |
|
||||
BRANCH_NAME="litellm_internal_dev_$(date +'%m_%d_%Y')"
|
||||
echo "Creating branch: $BRANCH_NAME"
|
||||
if gh api "repos/${{ github.repository }}/git/ref/heads/$BRANCH_NAME" --silent 2>/dev/null; then
|
||||
echo "Branch $BRANCH_NAME already exists. Skipping creation."
|
||||
exit 0
|
||||
fi
|
||||
MAIN_SHA=$(gh api "repos/${{ github.repository }}/git/ref/heads/main" --jq '.object.sha')
|
||||
gh api "repos/${{ github.repository }}/git/refs" -f ref="refs/heads/$BRANCH_NAME" -f sha="$MAIN_SHA" --silent
|
||||
echo "Successfully created branch: $BRANCH_NAME at $MAIN_SHA"
|
||||
|
|
@ -4,8 +4,6 @@ on:
|
|||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
- litellm_internal_staging
|
||||
- litellm_oss_staging
|
||||
- "litellm_**"
|
||||
paths:
|
||||
- "uv.lock"
|
||||
|
|
|
|||
1
.github/workflows/image-scan.yml
vendored
1
.github/workflows/image-scan.yml
vendored
|
|
@ -4,7 +4,6 @@ on:
|
|||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
- litellm_internal_staging
|
||||
- litellm_oss_branch
|
||||
- "litellm_**"
|
||||
paths:
|
||||
|
|
|
|||
2
.github/workflows/osv-scan.yml
vendored
2
.github/workflows/osv-scan.yml
vendored
|
|
@ -4,8 +4,6 @@ on:
|
|||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
- litellm_internal_staging
|
||||
- litellm_oss_staging
|
||||
- "litellm_**"
|
||||
schedule:
|
||||
- cron: "23 6 * * *"
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
name: Publish basedpyright base counts
|
||||
|
||||
# Every commit on main or litellm_internal_staging can become a future merge-base.
|
||||
# Every commit on main can become a future merge-base.
|
||||
# Publishing its per-rule basedpyright counts as an artifact lets
|
||||
# scripts/type_check_gate.py download them in seconds instead of paying a
|
||||
# 60-110s second basedpyright pass on every fresh worktree or moved merge-base.
|
||||
|
|
@ -11,7 +11,6 @@ on:
|
|||
push:
|
||||
branches:
|
||||
- main
|
||||
- litellm_internal_staging
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
ref:
|
||||
|
|
|
|||
3
.github/workflows/test-code-quality.yml
vendored
3
.github/workflows/test-code-quality.yml
vendored
|
|
@ -4,13 +4,10 @@ on:
|
|||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
- litellm_internal_staging
|
||||
- litellm_oss_staging
|
||||
- "litellm_**"
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- litellm_internal_staging
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
|
|
|||
2
.github/workflows/test-linting.yml
vendored
2
.github/workflows/test-linting.yml
vendored
|
|
@ -4,8 +4,6 @@ on:
|
|||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
- litellm_internal_staging
|
||||
- litellm_oss_staging
|
||||
- "litellm_**"
|
||||
|
||||
permissions:
|
||||
|
|
|
|||
2
.github/workflows/test-litellm-ui-build.yml
vendored
2
.github/workflows/test-litellm-ui-build.yml
vendored
|
|
@ -7,8 +7,6 @@ on:
|
|||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
- litellm_internal_staging
|
||||
- litellm_oss_staging
|
||||
- "litellm_**"
|
||||
|
||||
concurrency:
|
||||
|
|
|
|||
2
.github/workflows/test-litellm-ui-lint.yml
vendored
2
.github/workflows/test-litellm-ui-lint.yml
vendored
|
|
@ -6,8 +6,6 @@ on:
|
|||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
- litellm_internal_staging
|
||||
- litellm_oss_staging
|
||||
- "litellm_**"
|
||||
|
||||
concurrency:
|
||||
|
|
|
|||
3
.github/workflows/test-litellm-ui-unit.yml
vendored
3
.github/workflows/test-litellm-ui-unit.yml
vendored
|
|
@ -7,13 +7,10 @@ on:
|
|||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
- litellm_internal_staging
|
||||
- litellm_oss_staging
|
||||
- "litellm_**"
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- litellm_internal_staging
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
|
||||
|
|
|
|||
|
|
@ -4,8 +4,6 @@ on:
|
|||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
- litellm_internal_staging
|
||||
- litellm_oss_staging
|
||||
- "litellm_**"
|
||||
|
||||
permissions:
|
||||
|
|
|
|||
3
.github/workflows/test-postgres.yml
vendored
3
.github/workflows/test-postgres.yml
vendored
|
|
@ -4,13 +4,10 @@ on:
|
|||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
- litellm_internal_staging
|
||||
- litellm_oss_staging
|
||||
- "litellm_**"
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- litellm_internal_staging
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
|
|
|
|||
2
.github/workflows/test-redis-compat.yml
vendored
2
.github/workflows/test-redis-compat.yml
vendored
|
|
@ -4,8 +4,6 @@ on:
|
|||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
- litellm_internal_staging
|
||||
- litellm_oss_staging
|
||||
- "litellm_**"
|
||||
paths:
|
||||
- "litellm/_redis.py"
|
||||
|
|
|
|||
2
.github/workflows/test-rust.yml
vendored
2
.github/workflows/test-rust.yml
vendored
|
|
@ -29,8 +29,6 @@ on:
|
|||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
- litellm_internal_staging
|
||||
- litellm_oss_staging
|
||||
- "litellm_**"
|
||||
paths:
|
||||
- "litellm-rust/**"
|
||||
|
|
|
|||
2
.github/workflows/test-semgrep.yml
vendored
2
.github/workflows/test-semgrep.yml
vendored
|
|
@ -4,8 +4,6 @@ on:
|
|||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
- litellm_internal_staging
|
||||
- litellm_oss_staging
|
||||
- "litellm_**"
|
||||
|
||||
permissions:
|
||||
|
|
|
|||
2
.github/workflows/test-terraform-modules.yml
vendored
2
.github/workflows/test-terraform-modules.yml
vendored
|
|
@ -9,8 +9,6 @@ on:
|
|||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
- litellm_internal_staging
|
||||
- litellm_oss_staging
|
||||
- "litellm_**"
|
||||
paths:
|
||||
- "terraform/litellm/aws/**"
|
||||
|
|
|
|||
|
|
@ -8,8 +8,6 @@ on:
|
|||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
- litellm_internal_staging
|
||||
- litellm_oss_staging
|
||||
- "litellm_**"
|
||||
paths:
|
||||
- "terraform/provider/**"
|
||||
|
|
|
|||
|
|
@ -4,13 +4,10 @@ on:
|
|||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
- litellm_internal_staging
|
||||
- litellm_oss_staging
|
||||
- "litellm_**"
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- litellm_internal_staging
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
|
|
|||
3
.github/workflows/test-unit-proxy-db.yml
vendored
3
.github/workflows/test-unit-proxy-db.yml
vendored
|
|
@ -4,13 +4,10 @@ on:
|
|||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
- litellm_internal_staging
|
||||
- litellm_oss_staging
|
||||
- "litellm_**"
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- litellm_internal_staging
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
|
|
|
|||
3
.github/workflows/test-unit.yml
vendored
3
.github/workflows/test-unit.yml
vendored
|
|
@ -4,13 +4,10 @@ on:
|
|||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
- litellm_internal_staging
|
||||
- litellm_oss_staging
|
||||
- "litellm_**"
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- litellm_internal_staging
|
||||
workflow_dispatch:
|
||||
|
||||
permissions:
|
||||
|
|
|
|||
2
.github/workflows/test-vscode-extension.yml
vendored
2
.github/workflows/test-vscode-extension.yml
vendored
|
|
@ -6,8 +6,6 @@ on:
|
|||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
- litellm_internal_staging
|
||||
- litellm_oss_staging
|
||||
- "litellm_**"
|
||||
paths:
|
||||
- "vscode-extension/**"
|
||||
|
|
|
|||
4
.github/workflows/zizmor.yml
vendored
4
.github/workflows/zizmor.yml
vendored
|
|
@ -2,12 +2,10 @@ name: GitHub Actions Security Analysis
|
|||
|
||||
on:
|
||||
push:
|
||||
branches: [main, litellm_internal_staging]
|
||||
branches: [main]
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
- litellm_internal_staging
|
||||
- litellm_oss_staging
|
||||
- "litellm_**"
|
||||
|
||||
concurrency:
|
||||
|
|
|
|||
|
|
@ -263,7 +263,7 @@ describe("fixedBody", () => {
|
|||
describe("fixOf", () => {
|
||||
test("a merged pull request or a commit is a fix, whatever branch it was merged into", () => {
|
||||
expect(fixOf(closure(mergedPr), "BerriAI/litellm")).toEqual({ kind: "pull_request", number: 41767, oid: MERGE_COMMIT });
|
||||
expect(fixOf(closure({ ...mergedPr, baseRefName: "litellm_internal_staging" }), "BerriAI/litellm")).toEqual({ kind: "pull_request", number: 41767, oid: MERGE_COMMIT });
|
||||
expect(fixOf(closure({ ...mergedPr, baseRefName: "release_branch" }), "BerriAI/litellm")).toEqual({ kind: "pull_request", number: 41767, oid: MERGE_COMMIT });
|
||||
expect(fixOf(closure(commitCloser), "BerriAI/litellm")).toEqual({ kind: "commit", oid: MERGE_COMMIT });
|
||||
});
|
||||
|
||||
|
|
@ -315,7 +315,7 @@ describe("closeVerdict", () => {
|
|||
for (const base of ["release/v1.102.0-rc.2", "stable/v1.83.14", "v_1_83_3_stable_patch"]) {
|
||||
expect(closeVerdict(openPr(41760, { baseRefName: base }), config)).toEqual({ kind: "skip", reason: `targets the release line ${base}` });
|
||||
}
|
||||
expect(closeVerdict(openPr(41760, { baseRefName: "litellm_internal_staging" }), config).kind).toBe("candidate");
|
||||
expect(closeVerdict(openPr(41760, { baseRefName: "release_branch" }), config).kind).toBe("candidate");
|
||||
});
|
||||
|
||||
test("a pull request in a fork, one that is not open, or one linking no issue is left alone", () => {
|
||||
|
|
@ -404,8 +404,8 @@ describe("handleFixedIssue", () => {
|
|||
});
|
||||
|
||||
test("a fix merged into the retired development branch or pushed as a commit counts once it is on the default branch", async () => {
|
||||
const stagingPr = { ...mergedPr, baseRefName: "litellm_internal_staging" };
|
||||
const staging = openPr(41760, { baseRefName: "litellm_internal_staging", closingIssuesReferences: links(linkedIssue(ISSUE, stagingPr)) });
|
||||
const stagingPr = { ...mergedPr, baseRefName: "release_branch" };
|
||||
const staging = openPr(41760, { baseRefName: "release_branch", closingIssuesReferences: links(linkedIssue(ISSUE, stagingPr)) });
|
||||
const byCommit = openPr(41761, { closingIssuesReferences: links(linkedIssue(41751, commitCloser)) });
|
||||
const { api, writes } = fakeApi({ issue: closedBy(mergedPr, "CLOSED", [staging, byCommit]) });
|
||||
const { pullRequests } = await handleFixedIssue(api, config, ISSUE, noPause);
|
||||
|
|
@ -426,15 +426,15 @@ describe("handleFixedIssue", () => {
|
|||
});
|
||||
|
||||
test("the default branch comes from the config for the containment check and the comment alike", async () => {
|
||||
const stagingConfig = { ...config, defaultBranch: "litellm_internal_staging" };
|
||||
const closer = { ...mergedPr, baseRefName: "litellm_internal_staging" };
|
||||
const stagingConfig = { ...config, defaultBranch: "release_branch" };
|
||||
const closer = { ...mergedPr, baseRefName: "release_branch" };
|
||||
const { api, writes } = fakeApi({
|
||||
issue: closedBy(closer, "CLOSED", [openPr(41760, { closingIssuesReferences: links(linkedIssue(ISSUE, closer)) })]),
|
||||
reachable: { litellm_internal_staging: [MERGE_COMMIT] },
|
||||
reachable: { release_branch: [MERGE_COMMIT] },
|
||||
});
|
||||
const { pullRequests } = await handleFixedIssue(api, stagingConfig, ISSUE, noPause);
|
||||
expect(pullRequests).toEqual([{ kind: "closed", number: 41760, body: supersededBody([prFix()], "litellm_internal_staging") }]);
|
||||
expect(writes[1]).toContain("on litellm_internal_staging, so this pull request is closed");
|
||||
expect(pullRequests).toEqual([{ kind: "closed", number: 41760, body: supersededBody([prFix()], "release_branch") }]);
|
||||
expect(writes[1]).toContain("on release_branch, so this pull request is closed");
|
||||
});
|
||||
|
||||
test("the closer sits in the linked list as merged and gets neither a line nor a write", async () => {
|
||||
|
|
@ -533,11 +533,11 @@ describe("handleFixedIssue", () => {
|
|||
});
|
||||
|
||||
test("an issue closed from the retired development branch gets no comment but still closes its linked pull requests once the fix is on the default branch", async () => {
|
||||
const stagingPr = { ...mergedPr, baseRefName: "litellm_internal_staging" };
|
||||
const stagingPr = { ...mergedPr, baseRefName: "release_branch" };
|
||||
const staging = openPr(41760, { closingIssuesReferences: links(linkedIssue(ISSUE, stagingPr)) });
|
||||
const { api, writes } = fakeApi({ issue: closedBy(stagingPr, "CLOSED", [staging]) });
|
||||
const { comment, pullRequests } = await handleFixedIssue(api, config, ISSUE, noPause);
|
||||
expect(comment).toEqual({ kind: "skip", reason: "#41767 merged into litellm_internal_staging, not main" });
|
||||
expect(comment).toEqual({ kind: "skip", reason: "#41767 merged into release_branch, not main" });
|
||||
expect(pullRequests).toEqual([{ kind: "closed", number: 41760, body: oneFixBody }]);
|
||||
expect(writes.map((write) => write.split(" ")[1])).toEqual(["/repos/BerriAI/litellm/issues/41760/comments", "/repos/BerriAI/litellm/pulls/41760"]);
|
||||
});
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ detached worktree at the merge-base, run under the same environment so import
|
|||
resolution matches, and its per-rule counts are cached under the repo's git
|
||||
common dir keyed by merge-base commit, ``pyrightconfig.json``, ``uv.lock``,
|
||||
the Prisma schema, and the dependency-group set, so re-runs against the same
|
||||
branch point pay for it once. A CI workflow publishes every staging commit's counts as
|
||||
branch point pay for it once. A CI workflow publishes every main commit's counts as
|
||||
an artifact (``--emit-counts-dir`` is its entry point), and on a disk-cache miss
|
||||
the gate first tries to download the merge-base's artifact through the ``gh``
|
||||
CLI; any fetch failure falls back silently to the local base pass, so the gate
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ def _commit(repo: Path, message: str) -> None:
|
|||
def remote_and_clone(tmp_path: Path) -> tuple[Path, Path]:
|
||||
seed: Final = tmp_path / "seed"
|
||||
seed.mkdir()
|
||||
_git(seed, "init", "-q", "-b", "litellm_internal_staging")
|
||||
_git(seed, "init", "-q", "-b", "release_branch")
|
||||
(seed / "scripts").mkdir()
|
||||
for name in (
|
||||
"default_branch.py",
|
||||
|
|
@ -47,7 +47,7 @@ def remote_and_clone(tmp_path: Path) -> tuple[Path, Path]:
|
|||
_commit(seed, "main base")
|
||||
remote: Final = tmp_path / "remote.git"
|
||||
_git(tmp_path, "clone", "-q", "--bare", str(seed), str(remote))
|
||||
_git(remote, "symbolic-ref", "HEAD", "refs/heads/litellm_internal_staging")
|
||||
_git(remote, "symbolic-ref", "HEAD", "refs/heads/release_branch")
|
||||
repo: Final = tmp_path / "clone"
|
||||
_git(tmp_path, "clone", "-q", "--single-branch", str(remote), str(repo))
|
||||
return remote, repo
|
||||
|
|
@ -78,13 +78,13 @@ def test_existing_single_branch_clone_follows_remote_switch(remote_and_clone: tu
|
|||
remote, repo = remote_and_clone
|
||||
before: Final = _resolve(repo)
|
||||
assert before.returncode == 0, before.stderr
|
||||
assert before.stdout.strip() == "origin/litellm_internal_staging"
|
||||
assert before.stdout.strip() == "origin/release_branch"
|
||||
_git(remote, "symbolic-ref", "HEAD", "refs/heads/main")
|
||||
after: Final = _resolve(repo)
|
||||
assert after.returncode == 0, after.stderr
|
||||
assert after.stdout.strip() == "origin/main"
|
||||
assert _git(repo, "rev-parse", "origin/main") == _git(remote, "rev-parse", "main")
|
||||
assert _git(repo, "symbolic-ref", "refs/remotes/origin/HEAD").endswith("/litellm_internal_staging")
|
||||
assert _git(repo, "symbolic-ref", "refs/remotes/origin/HEAD").endswith("/release_branch")
|
||||
|
||||
|
||||
@pytest.mark.parametrize("missing_head", [False, True])
|
||||
|
|
@ -106,7 +106,7 @@ def test_unverifiable_default_never_uses_cached_head(
|
|||
assert "No changed" not in checked.stdout
|
||||
|
||||
|
||||
@pytest.mark.parametrize("base_ref", ["HEAD", "origin/litellm_internal_staging"])
|
||||
@pytest.mark.parametrize("base_ref", ["HEAD", "origin/release_branch"])
|
||||
def test_explicit_base_works_without_remote_access(
|
||||
remote_and_clone: tuple[Path, Path],
|
||||
base_ref: str,
|
||||
|
|
@ -134,7 +134,7 @@ def test_budget_ratchet_compares_against_new_default(remote_and_clone: tuple[Pat
|
|||
assert "limit raised 0 -> 1" in checked.stdout
|
||||
assert "base origin/main" in checked.stdout
|
||||
overridden: Final = subprocess.run(
|
||||
[*command, "--base", "origin/litellm_internal_staging"],
|
||||
[*command, "--base", "origin/release_branch"],
|
||||
cwd=repo,
|
||||
capture_output=True,
|
||||
text=True,
|
||||
|
|
@ -170,7 +170,7 @@ def test_migration_freshness_refuses_stale_branch_after_switch(remote_and_clone:
|
|||
after: Final = _freshness(repo)
|
||||
assert after.returncode == 3
|
||||
assert "1 commit(s) behind origin/main" in after.stderr
|
||||
overridden: Final = _freshness(repo, "litellm_internal_staging")
|
||||
overridden: Final = _freshness(repo, "release_branch")
|
||||
assert overridden.returncode == 0, overridden.stderr
|
||||
_git(repo, "merge", "--ff-only", "origin/main")
|
||||
updated: Final = _freshness(repo)
|
||||
|
|
@ -184,9 +184,9 @@ def test_migration_freshness_refuses_unavailable_remote(remote_and_clone: tuple[
|
|||
result: Final = _freshness(repo)
|
||||
assert result.returncode == 3
|
||||
assert "Could not discover origin's default branch" in result.stderr
|
||||
explicit: Final = _freshness(repo, "litellm_internal_staging")
|
||||
explicit: Final = _freshness(repo, "release_branch")
|
||||
assert explicit.returncode == 3
|
||||
assert "git fetch origin litellm_internal_staging" in explicit.stderr
|
||||
assert "git fetch origin release_branch" in explicit.stderr
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
|
|
|
|||
|
|
@ -246,7 +246,6 @@ def test_pre_push_rejects_non_conventional_branches(branch):
|
|||
"branch",
|
||||
[
|
||||
"main",
|
||||
"litellm_internal_staging",
|
||||
"dependabot/github_actions/foo",
|
||||
"gh-readonly-queue/main/abc123",
|
||||
],
|
||||
|
|
|
|||
|
|
@ -161,7 +161,7 @@ def _commit_all(repo: Path, message: str) -> None:
|
|||
)
|
||||
|
||||
|
||||
def _set_base_ref(repo: Path, branch: str = "litellm_internal_staging") -> None:
|
||||
def _set_base_ref(repo: Path, branch: str = "release_branch") -> None:
|
||||
remote = repo.parent / "remote.git"
|
||||
subprocess.run(["git", "clone", "-q", "--bare", str(repo), str(remote)], check=True)
|
||||
subprocess.run(["git", "update-ref", f"refs/heads/{branch}", "HEAD"], cwd=remote, check=True)
|
||||
|
|
@ -176,7 +176,7 @@ def _stage_file(repo: Path, relative: str, body: str) -> None:
|
|||
subprocess.run(["git", "add", relative], cwd=repo, check=True)
|
||||
|
||||
|
||||
@pytest.mark.parametrize("branch", ["litellm_internal_staging", "main"])
|
||||
@pytest.mark.parametrize("branch", ["release_branch", "main"])
|
||||
def test_nothing_staged_scopes_to_working_tree_diff_and_runs_checks(tmp_path: Path, branch: str) -> None:
|
||||
repo, bin_dir = _sandbox(tmp_path)
|
||||
_commit_all(repo, "base")
|
||||
|
|
|
|||
|
|
@ -108,7 +108,7 @@ def _run_step(tmp_path: Path, changed: list[str], base_sha: str = "basesha") ->
|
|||
env["BASE_SHA"] = base_sha
|
||||
env["HEAD_SHA"] = "headsha"
|
||||
env["GITHUB_WORKSPACE"] = str(REPO_ROOT)
|
||||
env["GITHUB_REF_NAME"] = "litellm_internal_staging"
|
||||
env["GITHUB_REF_NAME"] = "release_branch"
|
||||
env["CHANGED_FILES"] = str(changed_file)
|
||||
env["NPM_LOG"] = str(npm_log)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue