Skip to content

Conversation

philippschulte
Copy link
Member

@philippschulte philippschulte commented Jul 15, 2025

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?

Does not pass test yet!

Are there any considerations that need to be addressed for release?

This is a breaking change!

Notes for reviewers

The goal is to use one implementation for both account and workspace level rules. The same pattern can be applied for lists and signals. The necessary tooling is provided in this PR!

This PR should make it very do adopt the same pattern for lists and signals:

  • remove all WorkspaceID fields from the input structs
  • add common.scope to all input structs (the workspaceID needs to be added to the applies_to field inside the scope struct
  • use common.pathbuilder() to set the proper path in each request function
  • wrap the current test suite inside another a function which then gets call for a scope of "workspace" and "account"

Copy link
Contributor

@anthony-gomez-fastly anthony-gomez-fastly left a comment

Choose a reason for hiding this comment

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

LGTM once the tests pass! ty!!

@philippschulte
Copy link
Member Author

The rules test suite fails because scope type of "account" doesn't like the same config as with scope type of "workspace":

--- FAIL: TestClient_Rule_AccountScope (0.00s)
    api_test.go:191: 400 - Bad Request:
        
            Title:  The request does not validate or is improperly formed
            Detail: Validation failed - corp rules cannot use custom responses

@philippschulte philippschulte merged commit ca69c9b into fastly:main Jul 17, 2025
4 checks passed
@philippschulte philippschulte deleted the pschulte/combine-workspace-and-account-rules branch July 17, 2025 14:53
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.

2 participants