← Back to issue list

"name" validation is broken for names with 2 characters

View original Github issue

Metadata

Project
rockcraft
Number
#943
Type
issue
State
closed
Author
cjdcordeiro
Labels
Status: Triaged Type: Bug
Created
Updated
Closed

Current evaluation

Fixed by merged PR canonical/rockcraft#957 in commit 5a7a9789, allowing valid one- and two-character rock names.

Resolution: closed resolved

Reason: PR canonical/rockcraft#957 was merged as commit 5a7a9789, updating project-name validation to accept one- and two-character names and adding coverage for short names.

Evaluated by: mr-cal-bot

No scores available.

Issue body

### Bug Description When packing a rock with a 2-characters name, Rockcraft will raise a project validation exception, claiming the `name` is invalid, but with the wrong reasons. Relevant code: https://github.com/canonical/rockcraft/blob/f5d1ebb189890519a37e3e1d3cce347cee5eee36/rockcraft/models/project.py#L50 ### To Reproduce Pack the rockcraft.yaml below. ### Environment Tested with the `latest/edge` and `latest/stable` versions of Rockcraft ### rockcraft.yaml ```yaml name: jq # see https://documentation.ubuntu.com/rockcraft/en/latest/explanation/bases/ # for more information about bases and using 'bare' bases for chiselled rocks base: ubuntu@24.04 # the base environment for this rock version: '0.1' # just for humans. Semantic versioning is recommended summary: Single-line elevator pitch for your amazing rock # 79 char long summary description: | This is my-rock-name's description. You have a paragraph or two to tell the most important story about it. Keep it under 100 words though, we live in tweetspace and your description wants to look good in the container registries out there. platforms: # the platforms this rock should be built on and run on amd64: parts: my-part: plugin: nil ``` ### Relevant log output ```shell Bad rockcraft.yaml content: - invalid name for rock: Names can only use ASCII lowercase letters, numbers, and hyphens. They must start with a lowercase letter, may not end with a hyphen, and may not have two hyphens in a row. (in field 'name') For more information, check out: https://documentation.ubuntu.com/rockcraft/en/latest/reference/rockcraft.yaml ```

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha — closed resolved Fixed by merged PR canonical/rockcraft#957 in commit 5a7a9789, allowing valid one- and two-character rock names.
stealth/space-bunny-alpha — closed resolved Fixed by merged PR canonical/rockcraft#957 (commit 5a7a9789), allowing one- and two-character project names.
stealth/space-bunny-alpha — closed resolved Fixed by merged PR canonical/rockcraft#957 (commit 5a7a9789), which allows one- and two-character project names such as jq and handles short Pebble layer names.
stealth/space-bunny-alpha — closed resolved Fixed by merged PR canonical/rockcraft#957 in commit 5a7a9789, which allows one- and two-character project names.
qwen3.6-35b-a3b-mtp-q6 — — Validation failure for two-character names was fixed and merged in pull request #957. The issue is now closed.
qwen/qwen3.8-27b
Impact: 40
Quick Win: 32
Staleness: 35
Complexity: 20
Confidence: 80
Support Request: 0
close stale Rockcraft rejected valid 2-character rock names (e.g. 'jq') with a misleading validation error. Maintainer triaged it as a bug; a later commit allowed single/two-char names and recent testing on current main (1.17.0+) shows 'jq' is now accepted, so the issue appears no longer reproducible.
qwen/qwen3.6-35b-a3b
Staleness: 45
Complexity: 10
Confidence: 90
Support Request: 0
close stale Validation for 2-character rock names incorrectly fails with a misleading error. The bug appears fixed in current main, as 2-character names are now accepted without errors.
qwen3.6-35b-a3b-mtp-q6
Staleness: 20
Complexity: 10
Confidence: 95
Support Request: 0
close stale Validation error for 2-character rock names like jq is no longer reproducible on current main. Maintainer verified the fix and suggests closing unless someone can still reproduce.
qwen3.6-35b-a3b-mtp-q6
Staleness: 45
Complexity: 5
Confidence: 90
Support Request: 0
close stale Validation incorrectly rejects 2-character names. Recent testing confirms the bug is no longer reproducible on current main, indicating it was fixed.

Update history

Date Change
closed

Related work

  • Likely Fixed By: canonical/rockcraft#957 (confidence 100%)

    Merged resolving PR; commit 5a7a9789 allows single- and two-character project names.

Related issues

Issue Project State Summary Similarity
#957 Rocks 2419/allow single char names rockcraft merged Merged in canonical/rockcraft#2419 via commit 5a7a9789, allowing one- and two-character rock names and prefixing short Pebble layer names with -rockcraft-.
72%