Skip to content

[Breaking][CDTOOL-1187] Add support for the 'mode' parameter when enabling DDoS Protection #796

Merged
rcaril merged 6 commits intomainfrom
rcaril/CDTOOL-1187-add-support-for-mode-parameter-for-enabling-ddos
Mar 30, 2026
Merged

[Breaking][CDTOOL-1187] Add support for the 'mode' parameter when enabling DDoS Protection #796
rcaril merged 6 commits intomainfrom
rcaril/CDTOOL-1187-add-support-for-mode-parameter-for-enabling-ddos

Conversation

@rcaril
Copy link
Copy Markdown
Contributor

@rcaril rcaril commented Mar 27, 2026

Change summary

This PR adds support for passing the mode parameter when calling the Enable DDOS Protection endpoint. This was previously missing and only available through Update.

All Submissions:

  • Have you followed the guidelines in our Contributing document?
  • Have you checked to ensure there aren't other open Pull Requests for the same update/change?

New Feature Submissions:

  • Does your submission pass tests?

Changes to Core Features:

  • Have you written new tests for your core changes, as applicable?
  • Have you successfully run tests with your changes locally?

@rcaril rcaril marked this pull request as ready for review March 27, 2026 19:13
@rcaril rcaril requested a review from a team as a code owner March 27, 2026 19:13
@rcaril rcaril requested a review from philippschulte March 27, 2026 19:13
Copy link
Copy Markdown
Member

@philippschulte philippschulte left a comment

Choose a reason for hiding this comment

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

This looks functionally correct, and the added fixtures/tests for explicit mode are good.

My only concern is backward compatibility: changing Enable(...) to require an EnableInput argument is a breaking API change for existing consumers!

Comment thread fastly/products/ddosprotection/api.go
Reverted the breaking change to the 'Enable' func by maintaining the same "default" mode behavior and creating a new 'EnableWithInput' func which can be used to specify a 'mode'.
@rcaril rcaril requested a review from philippschulte March 27, 2026 19:58
@kpfleming
Copy link
Copy Markdown
Contributor

Given the very low number of users of go-fastly, I think a breaking change would be fine, and preferable to having a separate function. For the future, we should probably standardize on all 'action' functions accepting an input structure even if it is empty, so we can add fields to that structure in the future without a breaking change.

Copy link
Copy Markdown
Member

@philippschulte philippschulte left a comment

Choose a reason for hiding this comment

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

Looks good to me now. Preserving Enable(...) and adding EnableWithInput(...) avoids the breaking API change while still exposing mode. The added tests for explicit mode and verification are great. Thank you!

@rcaril
Copy link
Copy Markdown
Contributor Author

rcaril commented Mar 30, 2026

@kpfleming would you prefer if I reverted the secondary function changes at this point and moved forward with the breaking change for the sake of less complexity downstream?

@kpfleming
Copy link
Copy Markdown
Contributor

I'm a little concerned about setting a precedent that we'll be asked to continue in the future, that's it. If we can handle the breaking change in our own tools, I suspect that's a better path because it avoids any indication that we'll added secondary/tertiary/etc. functions in the future to avoid breaking changes.

@rcaril rcaril requested a review from kpfleming March 30, 2026 17:04
@rcaril rcaril changed the title [CDTOOL-1187] Add support for the 'mode' parameter when enabling DDoS Protection [Breaking][CDTOOL-1187] Add support for the 'mode' parameter when enabling DDoS Protection Mar 30, 2026
@rcaril rcaril requested a review from philippschulte March 30, 2026 17:06
Comment thread CHANGELOG.md Outdated
Co-authored-by: Kevin P. Fleming <kpfleming@users.noreply.github.com>
@rcaril rcaril merged commit 15b256d into main Mar 30, 2026
8 checks passed
@rcaril rcaril deleted the rcaril/CDTOOL-1187-add-support-for-mode-parameter-for-enabling-ddos branch March 30, 2026 18:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants