Skip to content

feat: enforce lowercase namespaces and rename two mixed-case namespaces - #1031

Open
matifali wants to merge 5 commits into
mainfrom
lint-lowercase-namespaces
Open

feat: enforce lowercase namespaces and rename two mixed-case namespaces#1031
matifali wants to merge 5 commits into
mainfrom
lint-lowercase-namespaces

Conversation

@matifali

@matifali matifali commented Jul 27, 2026

Copy link
Copy Markdown
Member

Problem

Namespace directories under registry/ are inconsistently cased. Four use mixed case (AJ0070, BenraouaneSoufiane, Excellencedev, IamTaoChen) while the other 21 are lowercase. The namespace becomes part of the case-sensitive module source path, so users end up with paths that are easy to mistype:

source = "registry.coder.com/BenraouaneSoufiane/rustdesk/coder"

Nothing stops the next contributor from adding another one.

Changes

Lint rule. validateNamespaceName validates namespace directories against a lowercase-only pattern (^[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$). Mixed-case names get an actionable error suggesting the lowercase form. Table test covers lowercase, grandfathered, mixed-case, and otherwise-invalid names. CONTRIBUTING.md documents the requirement.

Renamed the two namespaces that can move safely. Excellencedevexcellencedev and IamTaoCheniamtaochen. Both are templates-only with zero release tags, so no published module source path can break. Pure git mv, no content changes. display_name, github, and support_email frontmatter keep their original casing.

AJ0070 and BenraouaneSoufiane stay allowlisted. Both have published modules (pgadmin, rustdesk) whose source paths are case-sensitive, and registry-server has no alias mechanism for the old path. Renaming them needs server-side work first.

Namespace Release tags Renamed here
Excellencedev 0 Yes
IamTaoChen 0 Yes
AJ0070 2 (pgadmin) No, allowlisted
BenraouaneSoufiane 2 (rustdesk) No, allowlisted

No new CI job. The existing validate-readme-files job already runs this binary on every PR.

Validation

Validator runs clean on the renamed tree, go test, go vet, and bun x prettier --check all pass. Adding a mixed-case namespace fails as expected:

[erro] error when validating the repo structure
    error= Error during "File structure validation" phase of README validation:
           - "registry/TestBadNS": namespace name must be lowercase (use "testbadns")

Note

The two renamed namespaces change their registry.coder.com URLs, e.g. /templates/IamTaoChen/ssh-linux becomes /templates/iamtaochen/ssh-linux. There's no redirect mechanism, so old links will 404.

Closes #683

🤖 This PR was created with the help of Coder Agents, and needs a human review. 🧑‍💻

@matifali
matifali marked this pull request as draft July 27, 2026 14:01
@matifali matifali self-assigned this Jul 27, 2026
@matifali
matifali marked this pull request as ready for review July 27, 2026 16:28

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR strengthens the cmd/readmevalidation repo-structure validator by enforcing lowercase-only namespace directory names under registry/, while explicitly allowing the four legacy mixed-case namespaces to avoid breaking existing module source paths.

Changes:

  • Added validateNamespaceName with a lowercase-only namespace regex and a small allowlist for legacy mixed-case namespaces.
  • Added a table-driven unit test covering valid lowercase, grandfathered mixed-case, and invalid namespaces.
  • Documented the lowercase namespace requirement and rationale in CONTRIBUTING.md.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.

File Description
CONTRIBUTING.md Documents the new lowercase namespace directory requirement and rationale.
cmd/readmevalidation/repostructure.go Implements lowercase namespace validation with legacy allowlist and improved error messaging.
cmd/readmevalidation/repostructure_test.go Adds unit tests for the new namespace validation behavior.

Comment thread cmd/readmevalidation/repostructure_test.go
@matifali

matifali commented Aug 7, 2026

Copy link
Copy Markdown
Member Author

@codex review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Delightful!

Reviewed commit: a5ff1d0b91

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@matifali matifali changed the title feat(cmd/readmevalidation): enforce lowercase namespaces in registry feat: enforce lowercase namespaces and rename two mixed-case namespaces Aug 7, 2026

matifali commented Aug 7, 2026

Copy link
Copy Markdown
Member Author

cc: @IamTaoChen @Excellencedev

Heads-up: this PR lowercases your registry namespaces for consistency with the rest of the registry, IamTaoCheniamtaochen and Excellencedevexcellencedev. Only the directory name changes, no content edits.

Both of your namespaces contain templates only and have no release tags, so nothing breaks for anyone using them. The one visible change is the registry URL, e.g. registry.coder.com/templates/IamTaoChen/ssh-linux becomes registry.coder.com/templates/iamtaochen/ssh-linux. Old links will 404 since we have no redirect mechanism today.

Please update the links if you are using them anywhere in your portfolio.
🤖 This response was generated by Coder Agents.

@matifali
matifali requested a review from 35C4n0r August 7, 2026 11:01
Comment thread cmd/readmevalidation/repostructure.go Outdated

@35C4n0r 35C4n0r left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

minor nits, functionally lgtm.

Comment thread CONTRIBUTING.md Outdated
Comment thread cmd/readmevalidation/repostructure.go Outdated
@matifali
matifali requested a review from 35C4n0r August 7, 2026 17:11

@35C4n0r 35C4n0r left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM

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.

Lint: enforce lowercase namespaces in registry/

3 participants