Skip to content

test(sdn): drop the serviceexposure chainsaw suite left after the feature removal - #3336

Merged
IvanHunters merged 5 commits into
mainfrom
test/drop-dead-serviceexposure-suite
Jul 18, 2026
Merged

IvanHunters merged 5 commits into
mainfrom
test/drop-dead-serviceexposure-suite

Conversation

@androndo

@androndo Andrey Kolkov (androndo) commented Jul 17, 2026 •

Copy link
Copy Markdown
Contributor

What this PR does

Removes the dead serviceexposure chainsaw suite and its wiring. Commit 3dbc7d3 dropped ExposureClass/ServiceExposure (api/network, the controller, and the network.cozystack.io CRDs shipped in cozystack-controller/definitions) in favor of the native LoadBalancer path, but the chainsaw port that landed the next day (dd2f89d) brought the suite along, so it tests an API that no longer exists.

Since then every full-suite E2E run — any PR touching core paths, and every release cut — fails serviceexposure-delete and serviceexposure-externalips with no matches for network.cozystack.io/v1alpha1 (see the crust-gather snapshot of e.g. run 29561399440 on #3333: the network CRDs are absent while sibling CRDs from the same definitions/ dir, like tenantgateways.gateway.cozystack.io, are present, confirming the chart applied and the API is simply gone).

Alongside the suite dir this drops the suite_to_source case and its core-platform bats test in hack/select-install*, the now-unreachable - mapping mechanism itself (no suite returns it anymore and its only executable coverage was the removed bats test; re-adding the three lines with the next core-platform-owned suite is cheaper than keeping an untestable dead branch), and the suite list entry in hack/e2e-chainsaw/README.md. The securitygroup suite from the same port is alive and green and is untouched. If the native LoadBalancer replacement needs E2E coverage, that is a new suite against the new API, not a revival of this one.

Verified: hack/select-install.sh --validate passes (97 sources), select-install_test.bats 17/17, select-e2e_test.bats 13/13.

Release note

NONE

Summary by CodeRabbit

  • Bug Fixes

    • Tightened installation suite-to-PackageSource validation: serviceexposure no longer has special handling, and mappings to - are now treated as invalid unless the referenced PackageSource exists.
  • Tests

    • Removed Chainsaw E2E fixture coverage and manifests for serviceexposure, and updated the listed E2E suites accordingly.
    • Updated installation mapping tests to match the stricter validation and added a negative validation case for a missing mapped PackageSource.
  • Documentation

    • Updated contributing guidance to reference the networking.publishing.externalIPs → publishing.loadBalancerClass migration.

…ture removal

Commit 3dbc7d3 removed ExposureClass/ServiceExposure (api/network, the
controller, and the CRDs shipped in cozystack-controller/definitions) in
favor of the native LoadBalancer path, but the chainsaw port that landed
the next day (dd2f89d) brought the serviceexposure suite along. The
suite creates network.cozystack.io/v1alpha1 fixtures against an API that
no longer exists, so every full-suite run (any PR touching core paths,
and every release cut) fails its two tests with "no matches for
network.cozystack.io/v1alpha1".

Remove the dead suite and its wiring: the suite_to_source case and its
core-platform bats test in select-install (the "-" mechanism stays for
the next core-platform-owned suite), and the README suite list.

Co-Authored-By: Claude Fable 5 <[email protected]>
Signed-off-by: Andrey Kolkov <[email protected]>
@github-actions github-actions Bot added area/uncategorized PR auto-labeler could not map title scope to a known area/*; please review size/L This PR changes 100-499 lines, ignoring generated files labels Jul 17, 2026
@coderabbitai

coderabbitai Bot commented Jul 17, 2026 •

Copy link
Copy Markdown
Contributor

Review Change Stack

Note

Reviews paused

It looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the reviews.auto_review.auto_pause_after_reviewed_commits setting.

Use the following commands to manage reviews:

  • @coderabbitai resume to resume automatic reviews.
  • @coderabbitai review to trigger a single review.

Use the checkboxes below for quick actions:

  • ▶️ Resume reviews
  • 🔍 Trigger review
📝 Walkthrough

Walkthrough

The ServiceExposure Chainsaw suite and fixtures are removed. Installer mapping no longer special-cases the suite or accepts - as a no-op, tests enforce missing-source failures, and migration guidance is updated.

Changes

ServiceExposure suite removal

Layer / File(s) Summary
Remove ServiceExposure E2E suite
hack/e2e-chainsaw/README.md, hack/e2e-chainsaw/serviceexposure/*
The suite is removed from the Chainsaw suite list, and its test manifest and Kubernetes fixtures are deleted.

Installer mapping update

Layer / File(s) Summary
Update suite source resolution and validation
hack/select-install.sh, hack/select-install_test.bats, docs/agents/contributing.md
The serviceexposure special-case mapping and dedicated no-output test are removed; generic source resolution and strict PackageSource validation are applied, with updated migration guidance.

Estimated code review effort: 2 (Simple) | ~10 minutes

Possibly related PRs

Suggested labels: area/ci

Suggested reviewers: lexfrei

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly describes the main change: removing the obsolete serviceexposure Chainsaw suite after the feature was removed.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch test/drop-dead-serviceexposure-suite

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@gemini-code-assist

Copy link
Copy Markdown
Contributor

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request addresses persistent E2E test failures caused by the presence of a test suite targeting APIs that were previously removed. By deleting the 'serviceexposure' chainsaw suite and cleaning up the associated installation logic and documentation, the PR ensures that CI/CD pipelines and E2E runs remain stable and accurate.

Highlights

  • Removal of Obsolete Test Suite: Removed the 'serviceexposure' chainsaw suite, which was testing APIs that have been deprecated and removed from the codebase.
  • Cleanup of Infrastructure Wiring: Updated 'hack/select-install.sh' and its associated BATS tests to remove the mapping for the 'serviceexposure' suite, preventing E2E test failures.
  • Documentation Update: Updated 'hack/e2e-chainsaw/README.md' to reflect the removal of the 'serviceexposure' suite from the active test list.
New Features

🧠 You can now enable Memory (public preview) to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console.

Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment Gemini (@gemini-code-assist) Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize the Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counterproductive. You can react with 👍 and 👎 on Gemini (@gemini-code-assist) comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution. ↩

@dosubot dosubot Bot added area/testing Issues or PRs related to testing (e2e, bats, unit tests) kind/cleanup Categorizes issue or PR as related to cleanup of code, process, or technical debt labels Jul 17, 2026

@gemini-code-assist gemini-code-assist Bot 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.

Code Review

This pull request removes the serviceexposure e2e chainsaw test suite and cleans up its corresponding package mapping and unit tests in hack/select-install.sh and hack/select-install_test.bats. The feedback recommends introducing a dummy core-platform mapping and an associated test case to ensure that the - mapping mechanism remains covered by tests and does not become untested dead code.

Important

The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.

Comment thread hack/select-install.sh
Comment on lines 84 to 85
securitygroup) echo cozystack.securitygroup-controller ; return ;;
serviceexposure) echo - ; return ;;
esac

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.

low

Since the serviceexposure suite was removed, the - mapping mechanism in select-install.sh is now completely untested. To keep this mechanism verified and prevent it from becoming silent dead/broken code, we can introduce a dummy core-platform suite mapping for testing purposes.

Suggested change
securitygroup) echo cozystack.securitygroup-controller ; return ;;
serviceexposure) echo - ; return ;;
esac
securitygroup) echo cozystack.securitygroup-controller ; return ;;
dummy-core-platform) echo - ; return ;;
esac

Comment on lines 103 to 104

@test "core-platform suite contributes no package and emits no warning" {
# serviceexposure is a core-platform CRD; nothing to enable, no warning.
err=$(hack/select-install.sh "serviceexposure" 2>&1 1>/dev/null)
[ -z "$err" ]
output=$(hack/select-install.sh "serviceexposure" 2>/dev/null)
[ -z "$output" ]
}

@test "validate passes on the real source graph and suite mapping" {

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.

low

Add a test case using the dummy-core-platform mapping to ensure the - mechanism remains covered by unit tests.


@test "core-platform suite contributes no package and emits no warning" {
    err=$(hack/select-install.sh "dummy-core-platform" 2>&1 1>/dev/null)
    [ -z "$err" ]
    output=$(hack/select-install.sh "dummy-core-platform" 2>/dev/null)
    [ -z "$output" ]
}

@test "validate passes on the real source graph and suite mapping" {

With the serviceexposure case gone no suite returns "-", and the only
executable coverage of that branch was the bats test removed alongside
it. Keeping an untestable dead branch for a hypothetical future suite is
not worth it — re-adding the three lines with the next core-platform
suite is cheaper, and validate/closure both simplify.

Co-Authored-By: Claude Fable 5 <[email protected]>
Signed-off-by: Andrey Kolkov <[email protected]>
…lass

The downstream-coordination checklist still directed contributors at an
"externalIPs to exposureClass" migration; exposureClass was removed in
3dbc7d3 and the native replacement key is publishing.loadBalancerClass.
Last leftover of the ExposureClass removal this PR sweeps.

Co-Authored-By: Claude Fable 5 <[email protected]>
Signed-off-by: Andrey Kolkov <[email protected]>

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@docs/agents/contributing.md`:
- Line 198: Update the migration guidance in the contributing documentation to
reference the removed exposureClass key instead of externalIPs, while keeping
publishing.loadBalancerClass as the destination and preserving the other listed
values.yaml keys unchanged.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 019f8acb-2b88-433d-bf09-768a98ce1ef9

📥 Commits

Reviewing files that changed from the base of the PR and between 4e9a40d and f162735.

📒 Files selected for processing (1)
  • docs/agents/contributing.md

- Change the `cozy-system` namespace or the PSA pre-install hook contract → the role carries namespace-adoption logic written against the current behaviour of `packages/core/installer/templates/`.
- Add or rename a platform variant → the variant list is hardcoded in Go, in `cmd/cozystack-operator/main.go`; over there it is `cozystack_platform_variant` in `defaults/main.yml` and the README table.
- Change a `packages/core/platform/values.yaml` key the role sets — `networking.podCIDR`, `networking.podGateway`, `networking.serviceCIDR`, `networking.joinCIDR`, `publishing.host`, `publishing.apiServerEndpoint`, `publishing.externalIPs` → the role's platform-package template. The `externalIPs` to `exposureClass` migration in particular needs a coordinated PR there.
- Change a `packages/core/platform/values.yaml` key the role sets — `networking.podCIDR`, `networking.podGateway`, `networking.serviceCIDR`, `networking.joinCIDR`, `publishing.host`, `publishing.apiServerEndpoint`, `publishing.externalIPs` → the role's platform-package template. The `externalIPs` to `publishing.loadBalancerClass` migration in particular needs a coordinated PR there.

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.

🎯 Functional Correctness | 🟠 Major | ⚡ Quick win

Reference the removed exposureClass key, not externalIPs.

The coordinated migration is from exposureClass to publishing.loadBalancerClass; naming externalIPs makes the downstream Ansible guidance incorrect and could trigger an unrelated migration.

Proposed fix
-- Change a `packages/core/platform/values.yaml` key the role sets — `networking.podCIDR`, `networking.podGateway`, `networking.serviceCIDR`, `networking.joinCIDR`, `publishing.host`, `publishing.apiServerEndpoint`, `publishing.externalIPs` → the role's platform-package template. The `externalIPs` to `publishing.loadBalancerClass` migration in particular needs a coordinated PR there.
+- Change a `packages/core/platform/values.yaml` key the role sets — `networking.podCIDR`, `networking.podGateway`, `networking.serviceCIDR`, `networking.joinCIDR`, `publishing.host`, `publishing.apiServerEndpoint`, `publishing.externalIPs` → the role's platform-package template. The `exposureClass` to `publishing.loadBalancerClass` migration in particular needs a coordinated PR there.
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- Change a `packages/core/platform/values.yaml` key the role sets — `networking.podCIDR`, `networking.podGateway`, `networking.serviceCIDR`, `networking.joinCIDR`, `publishing.host`, `publishing.apiServerEndpoint`, `publishing.externalIPs` → the role's platform-package template. The `externalIPs` to `publishing.loadBalancerClass` migration in particular needs a coordinated PR there.
- Change a `packages/core/platform/values.yaml` key the role sets — `networking.podCIDR`, `networking.podGateway`, `networking.serviceCIDR`, `networking.joinCIDR`, `publishing.host`, `publishing.apiServerEndpoint`, `publishing.externalIPs` → the role's platform-package template. The `exposureClass` to `publishing.loadBalancerClass` migration in particular needs a coordinated PR there.
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@docs/agents/contributing.md` at line 198, Update the migration guidance in
the contributing documentation to reference the removed exposureClass key
instead of externalIPs, while keeping publishing.loadBalancerClass as the
destination and preserving the other listed values.yaml keys unchanged.

Scrub the last "-" mention from the --validate usage doc (the escape no
longer exists, so the header asserted the opposite of the behavior), and
add the negative bats case the tightened branch was missing: a suite
whose hardcoded mapping names a PackageSource absent from the graph must
fail validation with the "maps to ..., not a PackageSource" error.

Co-Authored-By: Claude Fable 5 <[email protected]>
Signed-off-by: Andrey Kolkov <[email protected]>

@coderabbitai coderabbitai Bot 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.

🧹 Nitpick comments (1)
hack/select-install_test.bats (1)

193-196: 📐 Maintainability & Code Quality | 🔵 Trivial | 💤 Low value

Use if to assert a non-zero exit.

While err=$(...) && { ... } functions correctly without triggering set -e (due to Bash's && semantics), the file's header explicitly establishes a convention: "To assert a NON-zero exit, invert with if so set -e doesn't abort the test."

For consistency with other tests and the file's guidelines, consider using an if statement.

♻️ Proposed refactor
-    err=$(hack/select-install.sh --validate "$tmp/sources" "$tmp/suites" 2>&1 1>/dev/null) && {
+    if err=$(hack/select-install.sh --validate "$tmp/sources" "$tmp/suites" 2>&1 1>/dev/null); then
         echo "expected validation to fail on a mapping to a missing source" >&2
         exit 1
-    }
+    fi
🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In `@hack/select-install_test.bats` around lines 193 - 196, Update the
validation-failure assertion around hack/select-install.sh to use an if
statement that handles the command substitution’s non-zero exit without
triggering set -e. Preserve capturing stderr in err and keep the existing
failure message and exit behavior when validation unexpectedly succeeds.
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Nitpick comments:
In `@hack/select-install_test.bats`:
- Around line 193-196: Update the validation-failure assertion around
hack/select-install.sh to use an if statement that handles the command
substitution’s non-zero exit without triggering set -e. Preserve capturing
stderr in err and keep the existing failure message and exit behavior when
validation unexpectedly succeeds.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

Run ID: 57655de9-a90d-459b-98ae-935b677cff2e

📥 Commits

Reviewing files that changed from the base of the PR and between f162735 and bbc0103.

📒 Files selected for processing (2)
  • hack/select-install.sh
  • hack/select-install_test.bats
🚧 Files skipped from review as they are similar to previous changes (1)
  • hack/select-install.sh

@IvanHunters IvanHunters left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Reviewed hermetically. LGTM with non-blocking notes. Clean and complete removal of a stale E2E fixture; coverage is preserved, not just deleted.

Removal completeness (verified twice):

  • grep for serviceexposure/ServiceExposure/ExposureClass and for the removed API group network.cozystack.io: zero hits across the tree.
  • The two remaining "-" occurrences in select-install.sh (L16, L53) are the unrelated read-from-stdin suites_arg="-" feature, not the removed suite_to_source sentinel; correctly left intact.
  • No CI workflow references the suite; there is no exposure controller in internal/controller.

Unblocking E2E: consistent with the hypothesis. The deleted fixture applied kind: ServiceExposure/ExposureClass in network.cozystack.io/v1alpha1, an API group that no longer exists, so the suite failed at apply time and passed select-install --validate only via the - sentinel, which masked the runtime break. The green E2E run is the final confirmation.

Prior concerns addressed:

  • The gemini suggestion to keep the - mapping via a dummy suite was resolved more cleanly: since serviceexposure was its sole consumer, the - sentinel was removed from suite_to_source() entirely and a fail-closed suite-mapping contract test was added in --validate.

Test adequacy: net coverage improves. The removed unit test only exercised the now-deleted - branch; the added validate detects a suite mapped to a source absent from the graph test pins the real fail-closed behaviour.

Non-blocking:

  • hack/select-install_test.bats:193: the new negative test asserts non-zero exit via err=$(...) && { ...; exit 1; }. It works, but the file header documents the house convention of inverting with if so set -e does not abort; every other test follows that idiom. Style-consistency only.

@IvanHunters
IvanHunters merged commit 28a59da into main Jul 18, 2026
22 of 23 checks passed
@IvanHunters
IvanHunters deleted the test/drop-dead-serviceexposure-suite branch July 18, 2026 13:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area/testing Issues or PRs related to testing (e2e, bats, unit tests) area/uncategorized PR auto-labeler could not map title scope to a known area/*; please review kind/cleanup Categorizes issue or PR as related to cleanup of code, process, or technical debt size/L This PR changes 100-499 lines, ignoring generated files

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants