Errors trying to label a repository with valid chars
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 45/100
Research direction
Reproduce the three pulp python repository label set examples and compare their behavior with the pulpcore serializer at pulpcore/app/serializers/fields.py around line 430. Trace how the CLI sends the label key, then make validation consistently accept or reject the documented characters and verify the three cases behave as intended.
Written by the indexing model from the issue text.
Description
Summary
Strange behavior in 'label set' command:
$ pulp python repository label set --key 'osv-dev ecosystem' --value 'test' --repository test-python
Error: {"key":["Enter a valid \"slug\" consisting of letters, numbers, underscores or hyphens."]}
$ pulp python repository label set --key 'osv_dev ecosystem' --value 'test' --repository test-python
Error: {"key":["Enter a valid \"slug\" consisting of letters, numbers, underscores or hyphens."]}
- I think pulp_labels_validator serializer considers space as valid, but this still failed:
$ pulp python repository label set --key 'osv dev ecosystem' --value 'test' --repository test-python
Error: {"key":["Enter a valid \"slug\" consisting of letters, numbers, underscores or hyphens."]}
- not sure how this passed the
pulp_labels_validatorserializer:
$ pulp python repository label set --key 'osv_dev-ecosystem' --value 'test' --repository test-python
$ pulp python repository show --name test-python |jq .pulp_labels
{
"osv_dev-ecosystem": "test"
}
Additonal context
From pulpcore code, it seems like space and underscore are allowed, but hyphens are not:
https://github.com/pulp/pulpcore/blob/9b6c47ffa88377de814c47c2ceb0cf819cf6f288/pulpcore/app/serializers/fields.py#L430
- Dominant language
- Python
- Stars
- 43
- Forks
- 52
- Avg merge
- 11h 38m
- Merged PRs (30d)
- 11
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from pulp/pulp-cli
-
bug Triage-Needed
Difficulty 2/5 1-3 hours Newbie friendliness 58/100
-
Difficulty 3/5 1-2 days Newbie friendliness 45/100
-
feature request
Difficulty 4/5 3-5 days Newbie friendliness 35/100
-
easy fix feature request
Difficulty 3/5 1-2 days Newbie friendliness 25/100
-
bug Triage-Needed
Difficulty 4/5 3-5 days Newbie friendliness 42/100
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
syfoud/Simulated_Scepter#172 ·
-
A cancelled tests run makes the coverage comment workflow fail and reports it as a red check on main Openarea: ci bug perceived difficulty: 3
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
Nitjsefnie-Harness-Commons/daedalus#921 · 1 comment ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 86/100
EleutherAI/lm-evaluation-harness#4207 ·
-
Difficulty 1/5 Under an hour Newbie friendliness 92/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
ClickHouse/clickhouse-connect#1057 ·