fix(service_definition): handle empty service_path for GitLab URLs and cmdline#400
Merged
sebastiancorrea81 merged 1 commit intoJun 22, 2026
Merged
Conversation
…line - service_definition/data.tf: fix leading %2F in GitLab API URLs when service_path is empty, causing 404 responses from the GitLab Files API - service_definition/locals.tf: introduce gitlab_path_sep local that emits %2F only when service_path is non-empty - service_definition_agent_association/main.tf: fix double slash in cmdline when service_path is empty Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
agustincelentano
approved these changes
Jun 22, 2026
This was referenced Jun 22, 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
service_definition/data.tf: whenservice_path = ""andgit_provider = "gitlab", the GitLab API URLs had a leading%2Fbeforespecs%2F...causing the Files API to return a 404/error instead of the file content. Fixed by introducing agitlab_path_seplocal that only emits%2Fwhenservice_pathis non-empty.service_definition/locals.tf: addedgitlab_path_seplocal.service_definition_agent_association/main.tf: whenservice_path = "", thecmdlinehad a double slash (//entrypoint/entrypoint). Fixed with a conditional to omit the path segment when empty.Root cause
Both modules concatenated
service_pathunconditionally with a/or%2Fseparator, producing invalid paths whenservice_pathis an empty string (repos where specs live at the repository root).Test plan
git_provider = "gitlab"withservice_path = ""— spec fetched correctly, no leading%2Fin URLgit_provider = "gitlab"withservice_path = "some/path"— existing behavior unchangedgit_provider = "github"— unaffected, no changes to GitHub URL constructionservice_definition_agent_associationwithservice_path = ""—cmdlinehas no double slash🤖 Generated with Claude Code