Repository navigation
fix(branch): log in with EMAIL/PASSWORD and manage own environments in BranchAPITest (DX-31579) - #277
Merged
reeshika-h merged 1 commit intoOct 28, 2026
Conversation
…in BranchAPITest BranchAPITest used TestClient.getStack(), which sends the management token. Branch create answered 401 (error 161) with it, and the test assumed the 'development' and 'production' environments exist on the stack. The class now: - logs in with EMAIL / PASSWORD and uses the apiKey header only; - creates two environments whose names are unique to the run, and deletes them, with every created branch (force=true), and logs out in @afterall; - polls fetch until a created branch is ready (bounded, 60s, 2s steps); - treats a rejected create as no branch when fetch answers 422 with error_code 905, the same answer as a missing branch; - adds TC-23 (create without publish_config) and TC-24 (environment name in a different case gets 422). Without EMAIL, PASSWORD or apiKey in .env the class is skipped with a "not run" message. TestClient gains public EMAIL and PASSWORD constants and isApiKeyConfigured(). Refs: DX-31579 Co-authored-by: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ef6P4M5YRs6tDbdFqkvmZc
✅ Snyk checks have passed. No issues have been found so far.
💻 Catch issues earlier using the plugins for VS Code, JetBrains IDEs, Visual Studio, and Eclipse. |
🔒 Security Scan Results
⏱️ SLA Breach Summary
✅ BUILD PASSED - All security checks passed |
reeshika-h
merged commit Oct 28, 2026
6a5e5d2
into
epic/DX-31560-branch-create-environments
9 checks passed
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
AI-authored (Claude Code), run under the assignee's account.
Fixes DX-31579 (Epic DX-31560, blocks QA story DX-31569).
Problem:
BranchAPITestusedTestClient.getStack()(management token), so every branch create returned 401 / 161. It also assumeddevelopmentandproductionexist on the stack.Change (
BranchAPITest.java,TestClient.java):@BeforeAll:login(EMAIL, PASSWORD), stack built with the API key header only; creates two run-unique environments.publish_config) and the TC-24 case variant (422). A rejected create means fetch 422 / 905, not 404.@AfterAll: deletes branches (force=true), the environments, then logs out.EMAIL/PASSWORD/API key: the class is skipped with a "not run" message.TestClientgains publicEMAIL,PASSWORD,isApiKeyConfigured().Verification:
mvn -q test-compilepasses; the no-credentials path was run through the JUnit launcher and aborts (skip), not a pass. The live suite was NOT run: no credentials in this environment. A person or the QA agent must run it against dev11. Reviewer verdict: pass, 3 nits (cleanup catches IOException only; rejected-create uids not tracked; key not trimmed).Known gap (not in this PR):
pom.xmlhard-codesskipTests, so-DskipTests=falseruns nothing; separate ticket per DX-31579.Generated by Claude Code