Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: bulk enable/disable audits #302

Draft
wants to merge 30 commits into
base: main
Choose a base branch
from
Draft

feat: bulk enable/disable audits #302

wants to merge 30 commits into from

Conversation

alinarublea
Copy link
Contributor

@alinarublea alinarublea commented May 17, 2024

Please ensure your pull request adheres to the following guidelines:

  • create fix unit/tests
  • refactor the new the slack command

Copy link

This PR will trigger a minor release when merged.

schema:
type: object
properties:
baseURLs:
Copy link
Member

Choose a reason for hiding this comment

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

the primary key of sites is the siteId (as used in routes like /sites/<siteId> for example) - is it a conscious decision to use baseURL instead?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, it is coming from #115, because if we want to easily use the API, we know the baseURL of a site, whereas for the id we need to do another request

Copy link
Member

Choose a reason for hiding this comment

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

@iuliag can you elaborate? i don't see in #115 where the requirement/fact that we only have baseURLs comes from. the API usually works with ids.

Copy link
Contributor

@iuliag iuliag May 23, 2024

Choose a reason for hiding this comment

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

@solaris007 , the consumers generally know the site URL and it's a hassle for them to:

In all requests we've received about configuring/looking at some data for a site, only the URL is mentioned (or sometimes just the customer name), not the site id.

src/controllers/sites.js Outdated Show resolved Hide resolved
- site
summary: Enable audits for multiple sites
description: |
This endpoint is useful for enabling audit types for multiple sites.
Copy link
Member

Choose a reason for hiding this comment

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

The description and operationId don't seem to match to what the code does, which is also affect organization config...

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is because as of now, we cannot enable a site without enabling the org. Please confirm @iuliag or @ekremney

Copy link
Member

Choose a reason for hiding this comment

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

that's fine - all i'm saying is the API doc should transparently describe the effects.

Copy link
Contributor

Choose a reason for hiding this comment

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

I agree to rename to make this more clear.

Specifically for enabling the org, I will add here the discussion I had with @alinarublea :
Users might not always want to enable/disable at the org level when they do this for the site.
E.g. case we had with a customer, where we had to enable the whole org and disable a part of the sites within that org. So we need a way to disable at site level without disabling at the same time at org level.

For enable = true, it's pointless to enable just the site, because anyways the audit doesn't run unless the org is enabled as well. In this case, we'd want to unify those 2 changes in 1 API call.

@alinarublea alinarublea changed the title feat: bulk toggle audits feat: bulk enable/disable audit configs May 23, 2024
- site
summary: Enable audits for multiple sites
description: |
This endpoint is useful for enabling audit types for multiple sites.
Copy link
Member

Choose a reason for hiding this comment

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

that's fine - all i'm saying is the API doc should transparently describe the effects.

schema:
type: object
properties:
baseURLs:
Copy link
Member

Choose a reason for hiding this comment

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

@iuliag can you elaborate? i don't see in #115 where the requirement/fact that we only have baseURLs comes from. the API usually works with ids.

package.json Outdated Show resolved Hide resolved
@alinarublea alinarublea requested a review from dzehnder May 29, 2024 11:46
@alinarublea alinarublea changed the title feat: bulk enable/disable audit configs feat: bulk enable/disable audits Aug 29, 2024
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.

API to enable/disable audit and audit type(s) in bulk for given a list of sites
3 participants