Skip to content

fix(service_definition): handle empty service_path for GitLab URLs and cmdline#400

Merged
sebastiancorrea81 merged 1 commit into
mainfrom
fix/service-definition-empty-service-path
Jun 22, 2026
Merged

fix(service_definition): handle empty service_path for GitLab URLs and cmdline#400
sebastiancorrea81 merged 1 commit into
mainfrom
fix/service-definition-empty-service-path

Conversation

@sebastiancorrea81

Copy link
Copy Markdown
Collaborator

Summary

  • service_definition/data.tf: when service_path = "" and git_provider = "gitlab", the GitLab API URLs had a leading %2F before specs%2F... causing the Files API to return a 404/error instead of the file content. Fixed by introducing a gitlab_path_sep local that only emits %2F when service_path is non-empty.
  • service_definition/locals.tf: added gitlab_path_sep local.
  • service_definition_agent_association/main.tf: when service_path = "", the cmdline had a double slash (//entrypoint/entrypoint). Fixed with a conditional to omit the path segment when empty.

Root cause

Both modules concatenated service_path unconditionally with a / or %2F separator, producing invalid paths when service_path is an empty string (repos where specs live at the repository root).

Test plan

  • git_provider = "gitlab" with service_path = "" — spec fetched correctly, no leading %2F in URL
  • git_provider = "gitlab" with service_path = "some/path" — existing behavior unchanged
  • git_provider = "github" — unaffected, no changes to GitHub URL construction
  • service_definition_agent_association with service_path = ""cmdline has no double slash

🤖 Generated with Claude Code

…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>
@sebastiancorrea81 sebastiancorrea81 merged commit 826e016 into main Jun 22, 2026
44 checks passed
@sebastiancorrea81 sebastiancorrea81 deleted the fix/service-definition-empty-service-path branch June 22, 2026 13:24
This was referenced Jun 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants