Skip to content

test(instance): cover security-group create output format - #6158

Closed
ousamabenyounes wants to merge 2 commits into
scaleway:mainfrom
ousamabenyounes:fix/issue-6153
Closed

ousamabenyounes wants to merge 2 commits into
scaleway:mainfrom
ousamabenyounes:fix/issue-6153

Conversation

@ousamabenyounes

@ousamabenyounes ousamabenyounes commented Sep 8, 2026 •

Copy link
Copy Markdown
Contributor

What

Adds integration coverage for the current scw instance security-group create -o json response contract:

  • keeps the top-level security_group wrapper;
  • covers successful creation and API errors with recorded cassettes and goldens;
  • uses the wrapped response in test cleanup.

Why

The proposed unwrapping was removed after review because changing the JSON shape would break compatibility. This PR now only locks the existing behavior with regression coverage.

Validation

  • go test ./internal/namespaces/instance/v1 -run Test_SecurityGroupCreate -count=1 passes.
  • Full baseline and final mise run ci replays are iso-baseline: 2,623 final tests, 17 skipped, and the same six pre-existing internal/namespaces/container/v1 Test_Deploy cassette misses. instance/v1 passes and WASM is 9/9.
  • Independent code review and Claude/OCR review pass.

@ousamabenyounes
ousamabenyounes requested a review from a team as a code owner September 8, 2026 20:40
@github-actions github-actions Bot added the instance Instance issues, bugs and feature requests label Sep 8, 2026

@elwinar elwinar left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

At the moment, I'm not sure this is something we want to change. This is not strictly a bug as we don't have a convention in place on this (a quick look at the various golden files makes it obvious), so we're probably not going to change the format and break compatibility. The additional test is welcomed tho, if you want to re-submit without the fix that is something I'll be willing to approve.

@ousamabenyounes ousamabenyounes changed the title fix(instance): unwrap security-group create output to match get and list test(instance): cover security-group create output format Sep 16, 2026
@ousamabenyounes

Copy link
Copy Markdown
Contributor Author

Updated in d77ccc1: removed the JSON unwrapping entirely and kept only regression coverage for the existing wrapped security_group response. The targeted Go test passes; GitHub’s CI workflow is awaiting maintainer approval.

@ousamabenyounes

Copy link
Copy Markdown
Contributor Author

Follow-up pushed in c348a7a: deduplicated the shared security-group create command after independent review. The targeted test passes; full local CI remains iso-baseline, and Claude/OCR review passes. GitHub CI requires maintainer approval to run.

@elwinar

elwinar commented Oct 15, 2026

Copy link
Copy Markdown
Contributor

I've finally taken the time to review here, can you please sign your commits before we can merge? Also of note, I've rebased your branch to get the latest changes in workflows.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

instance Instance issues, bugs and feature requests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants