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

Update identifier pattern in schemas to allow dots in strings #679

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

Conversation

raks-tt
Copy link

@raks-tt raks-tt commented Jun 24, 2024

This change modifies the identifier pattern to accommodate
strings with dots (.) such as 'raks.tt' in user-1.yml schema.

This change modifies the identifier pattern to accommodate
 strings with dots (.) such as 'raks.tt' in user-1.yml schema.
@app-sre-bot
Copy link

Can one of the admins verify this patch?

@rporres
Copy link
Contributor

rporres commented Jun 25, 2024

Can you add some context to this proposal? What's the problem you're trying to solve?

@raks-tt
Copy link
Author

raks-tt commented Jun 25, 2024

Can you add some context to this proposal? What's the problem you're trying to solve?

@rporres - The issue is we use this in the Konflux repo for validating the schemas. So if we have a string with a "." for eg: raks.tt is my username in quay, the Job will fail.

Here is the errror:

"error": "'raks.tt' does not match '^[A-Za-z0-9][A-Za-z0-9-_]{0,30}[A-Za-z0-9]$'\n\nFailed validating 'pattern' in schema['properties']['quay_username']:\n    {'pattern': '^[A-Za-z0-9][A-Za-z0-9-_]{0,30}[A-Za-z0-9]$',\n     'type': 'string'}\n\nOn instance['quay_username']:\n    'raks.tt'",

            "schema_url": "/access/user-1.yml"

@rporres
Copy link
Contributor

rporres commented Jul 3, 2024

If I understand correctly, the problem you're trying to solve is the quay_username property from the /access/user-1.yml schema. Apparently it allows for dots whereas we don't.

The problem with your patch is that it modifies a type definition that's used in many places, so we cannot accept it as it is. You should just change the quay_username property. You can define a pattern that a property must comply with directly in the schema. You can see an example of how to do it in the same schemas/access/user-1.yml file, e.g. the aws_username.

Do you have any documentation of the accepted characters of the usernames in quay?

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.

3 participants