Skip to content

set stage api urls to stage-blue for us and eu - #261

Merged
dmou-ps merged 3 commits into
developfrom
set-stage-api-url-to-blue
Jul 30, 2026
Merged

set stage api urls to stage-blue for us and eu#261
dmou-ps merged 3 commits into
developfrom
set-stage-api-url-to-blue

Conversation

@admin-dmou-ps

Copy link
Copy Markdown
Contributor

No description provided.

@admin-dmou-ps
admin-dmou-ps requested a review from sbneto July 24, 2026 21:15
sbneto
sbneto previously approved these changes Jul 24, 2026
@claude

claude Bot commented Jul 24, 2026

Copy link
Copy Markdown

Review — one blocker, otherwise clean.

Correctness / test coverage — tests/api_uri_test.py:136 was missed, suite is red

test_each_shortcut_resolves (line 54) and test_stage_shortcut (line 127) were updated, but the per-shortcut EU test still asserts the old host:

    def test_stage_eu_shortcut(self):
        assert self._resolved_base("--stage-eu") == "https://api.stage-eu-v3.polyswarm.network/v3"

That fails against the new API_URI_SHORTCUTS["stage_eu"] = https://api.stage-eu-blue.polyswarm.network/v3. Fix to stage-eu-blue to match line 54.

Everything else checks out:

  • Base is develop per the AGENTS.md gitflow rule; no pyproject.toml version bump, correct for a feature PR.
  • Help strings for --stage / --stage-eu and the module docstring example were all updated in lockstep with the constant — no stale copies of the old hosts remain anywhere outside the one test line above.
  • No spec drift: specs/01-architecture.md documents the shortcut names and the resolution precedence, not the concrete stage hosts, so nothing there needs editing. PROD_API_URI and the resolution logic are untouched.
  • No downstream contract change — API_URI_SHORTCUTS values shift, but no signatures, exception classes, or SDK-boundary surface move.

@claude

claude Bot commented Jul 24, 2026

Copy link
Copy Markdown

Reviewed against AGENTS.md and specs/01-architecture.md. The change itself is correct and complete: both API_URI_SHORTCUTS entries, both --help strings, and the module docstring example are updated in lockstep, and the tests cover both the constant-equality guard (test_each_shortcut_resolves) and the end-to-end resolved base for --stage / --stage-eu. No other references to the old hosts anywhere in the repo (no README, spec, or cassette mentions). specs/01-architecture.md describes the resolution mechanism and only hardcodes PROD_API_URI, so no spec update is owed here. Base is develop and no pyproject.toml version bump — both correct per the gitflow rules.

Two things:

1. Commit messages are missing conventional prefixes. AGENTS.md"Conventional commit prefixes (feat:, fix:, refactor:, chore:, docs:, test:)". Both commits (set stage api urls to stage-blue for us and eu, update eu shortcut test) are bare. Suggest chore: point stage/stage-eu shortcuts at stage-blue ingress on a reword/squash. The PR body is also empty — a one-liner on why the ingress moved would help whoever bisects this in six months.

2. Deploy-slot coupling in a user-facing shortcut (design question, not a blocker). stage-blue / stage-eu-blue are blue/green slot hostnames, whereas the neighbouring entries (prod, prod-eu-v3) are slot-neutral. If stage ever cuts over to green, --stage and --stage-eu silently point at the idle stack, and the failure mode is confusing (stale-looking or 5xx responses, not a clear error). If a slot-neutral alias exists (e.g. an api.stage-v3 CNAME retargeted at whichever slot is live), that is the more durable thing to encode. If the -blue hosts are deliberately the long-lived stage endpoints now, worth saying so in the PR body so the next person does not 'fix"' the asymmetry back.

@claude

claude Bot commented Jul 24, 2026

Copy link
Copy Markdown

Reviewed against AGENTS.md + specs/01-architecture.md. The URL swap itself is consistent: API_URI_SHORTCUTS, both --stage/--stage-eu help strings, the module docstring comment, and all three test assertions move together, and no spec hardcodes the staging hosts (specs/01-architecture.md only names the flags and the precedence rules), so no spec update is needed.

Two issues:

1. Version bump does not belong in this PR (AGENTS.md, Gitflow).
pyproject.toml 4.2.0 → 4.2.1, [tool.bumpversion] current_version, and src/polyswarm/__init__.py are all bumped here. AGENTS.md:

PyPI release happens automatically when pyproject.toml's version changes on master. Don't bump the version inside a feature PR unless the maintainer specifically asks — version bumps belong to the develop → master step.

Concretely: carrying the bump on the feature branch means the next develop → master PR fires a PyPI release for 4.2.1 covering whatever else has accumulated on develop, not just this change — the release decision gets made implicitly by this merge rather than by the maintainer at release time. Please drop the three version edits unless a maintainer asked for them. (Base branch is correct — develop.)

2. Is stage-blue / stage-eu-blue a stable alias or a deploy slot?
If those hosts are blue/green deploy slots, pinning --stage to the blue slot means the shortcut silently points at the wrong environment after every swap, and tests/api_uri_test.py:48 (# guard against the constant drifting from the verified ingress hosts) will hard-fail the suite on each swap rather than just being stale. If a slot-independent alias (e.g. the previous api.stage-v3… name) still resolves to the active stage ingress, that is the better target. If blue is genuinely the permanent stage ingress now, say so in the PR body — the PR description is currently empty, so there is no record of why the hosts moved.

No correctness or coverage gaps otherwise; the shortcut resolution logic is untouched and the parametrised host assertions cover both new values.

@dmou-ps
dmou-ps requested a review from sbneto July 24, 2026 22:23
@dmou-ps
dmou-ps merged commit 1c3322e into develop Jul 30, 2026
2 checks passed
@dmou-ps
dmou-ps deleted the set-stage-api-url-to-blue branch July 30, 2026 17:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

3 participants