Repository navigation
fix(bamboo): return an error instead of log.Fatal on a bad endpoint - #9403
Merged
klesh merged 1 commit intoNov 19, 2026
Merged
Conversation
ConvertDeployBuildsToDeploymentCommits parsed the connection endpoint for every deploy build and called log.Fatal if it failed, so an endpoint that url.Parse rejects (e.g. a non-numeric port) exited the whole DevLake process instead of failing the subtask. Parse the endpoint once before the query, return the parse error, and add a unit test for it. Generated-by: Claude Code (Claude Opus 5.5) Signed-off-by: Shivam Sharma <192242476+ShivamSharma43@users.noreply.github.com> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
klesh
approved these changes
Nov 19, 2026
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.
Summary
The Bamboo
convertDeployBuildsToDeploymentCommitssubtask parses the connection endpoint once for every deploy build. If the parse fails, it callslog.Fatal:log.Fatalcallsos.Exit(1). A connection endpoint thaturl.Parserejects, for example a non-numeric port (http://bamboo.example.com:port/rest/api/latest/), doesn't just fail this subtask. It kills the whole DevLake server process, with every other pipeline running in it, and no error is recorded for the task.Changes:
tasks/deploy_build_to_deployment_commit_convertor.go: the endpoint is parsed once, before the query, and a parse error is returned as the subtask error (failed to parse the Bamboo endpoint). The base URL is then reused for each row, so the endpoint isn't re-parsed per build. Thelogimport goes away. The generated deployment URLs don't change.tasks/deploy_build_to_deployment_commit_convertor_test.go(new): runs the subtask with an endpoint that has an invalid port and checks that it returns that error without querying the database. With the old code the subtask queries the database before it looks at the endpoint, so the test fails (mock: I don't know what to return because the method call was unexpected). In a real run it would reachlog.Fatalon the first row.The e2e snapshots don't change.
Does this close any open issues?
No issue is open for this. The bug is described above.
Screenshots
N/A
Other Information
go test ./plugins/bamboo/tasks/: pass. The bamboo e2e tests needE2E_DB_URL, which I didn't run locally. Their output can't change, because the base URL is built the same way as before.go vet ./plugins/bamboo/...andgofmt: clean.pr-type/bug-fix.Generated-by:trailer, following the ASF generative tooling guidance.🤖 Generated with Claude Code