Skip to content

fix(test): e2e mock server should return string IDs after UUID migration#33

Merged
omattsson merged 2 commits intomainfrom
fix/e2e-mock-string-ids
Apr 18, 2026
Merged

fix(test): e2e mock server should return string IDs after UUID migration#33
omattsson merged 2 commits intomainfrom
fix/e2e-mock-string-ids

Conversation

@omattsson
Copy link
Copy Markdown
Owner

Summary

  • The e2e mock server was emitting integer id / version literals (and stack_definition_id, instance_id, chart_id). After the UUID migration these fields are all string on the Go side, so json.Unmarshal rejected every login response with "cannot unmarshal number into Go struct field ... of type string" — the error was hidden because runStackctl returned the bare exec.ExitError.
  • Bulk-op handlers in startE2EQuietPipingMockServer decoded IDs []uint; switched to []string so they match the client payload.

This is the root cause of the Test job failing on main since 2026-04-17 and, by extension, on every PR based on main (including dependabot PR #27).

Test plan

  • go test ./... — all packages green locally
  • CI Test job green on this branch

🤖 Generated with Claude Code

Post-UUID migration, Base.ID, Base.Version, StackDefinitionID,
InstanceID, and ChartID are all strings. The e2e mock server was
still returning integer literals, causing every login/stack/override
test to fail with "json: cannot unmarshal number into Go struct
field ... of type string".

Also switch bulk-op decode struct from []uint to []string so the
mock accepts the client's string IDs.
Copilot AI review requested due to automatic review settings April 18, 2026 09:09
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Updates the CLI e2e mock servers to align with the post-UUID-migration Go types (IDs/versions now unmarshaled as string), preventing JSON unmarshal failures that were breaking the Test job.

Changes:

  • Switched mock server JSON fields (id, version, and related foreign key fields) from numeric literals to strings.
  • Updated quiet-piping bulk handlers to decode request payloads as IDs []string (matching the client payload).
  • Added strconv usage to emit string IDs for incremented deployment log IDs.

The govulncheck job installs Go via actions/setup-go using
go-version-file: cli/go.mod, which was still declaring 1.26.1.
All four reported vulnerabilities (GO-2026-4947/4946/4870/4866
in crypto/x509 and crypto/tls) are fixed in go1.26.2.

Matches the Dockerfile bump in #27 — keeping the two declarations
in sync avoids divergence between dev-loop tools and CI.
@omattsson omattsson merged commit 4c7fb7e into main Apr 18, 2026
4 checks passed
@omattsson omattsson deleted the fix/e2e-mock-string-ids branch April 18, 2026 09:14
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