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

Fixes #740: Expand patterns in settings #741

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

leplatrem
Copy link
Contributor

@leplatrem leplatrem commented Jan 28, 2025

fixes #740

With this approach, we turn glob settings into real settings:

  • expanded settings show up in root URL capabilities output
  • no modification of existing code around permission verification
  • only read list of collections in DB on startup and when a new collection is created

Current limitations:

  • cannot use . in regexps to match collections names (eg ([a-zA-Z0-9_-]*) instead of (.*))
  • have to use ( ) to enable expansions

I believe it is good enough to get started with our use case (see issue description)

@leplatrem leplatrem force-pushed the 740-expand-patterns-config branch from 778cd01 to 4bc9bff Compare January 29, 2025 10:56
@leplatrem leplatrem force-pushed the 740-expand-patterns-config branch 2 times, most recently from c67bc52 to 704fd19 Compare January 30, 2025 11:20
@leplatrem leplatrem marked this pull request as ready for review January 30, 2025 11:23
@leplatrem leplatrem requested a review from a team as a code owner January 30, 2025 11:23
@leplatrem leplatrem force-pushed the 740-expand-patterns-config branch from 49ea66f to 8901f50 Compare January 30, 2025 12:20
config/local.ini Outdated
@@ -114,6 +114,9 @@ kinto.signer.autograph.server_url = http://autograph:8000
kinto.signer.autograph.hawk_id = kintodev
kinto.signer.autograph.hawk_secret = 3isey64n25fim18chqgewirm6z2gwva1mas0eu71e9jtisdwv6bd

# quicksuggest collections don't new review
kinto.signer.staging.quicksuggest-(\w+)-(desktop|mobile).to_review_enabled = false
Copy link
Contributor

Choose a reason for hiding this comment

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

Nice first addition

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I had the bucket wrong :) it's main-workspace

@@ -154,9 +155,11 @@ def includeme(config):
r, ["source", "destination", "preview", "to_review_enabled"]
)
for r in resources.values()
if "(" not in str(r["source"]) # do not show patterns
Copy link
Contributor

Choose a reason for hiding this comment

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

Removing this line does not affect the unit tests.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Hmm, I don't agree:

FAILED kinto-remote-settings/tests/signer/test_plugin_setup.py::ExpandedSettingsTest::test_expanded_settings_are_updated_on_collection_creation - AssertionError: assert 'magic-(\\w+)' not in {None, 'source', 'magic-(\\w+)', 'from', 'onecrl'}

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.

Add regexp/pattern support to disable signoff on multiple collections
2 participants