Skip to content

Trim whitespace from pending publisher project names - #20609

Open
YS-OH-CORE wants to merge 1 commit into
pypi:mainfrom
YS-OH-CORE:fix/trim-pending-publisher-project-name
Open

YS-OH-CORE wants to merge 1 commit into
pypi:mainfrom
YS-OH-CORE:fix/trim-pending-publisher-project-name

Conversation

@YS-OH-CORE

Copy link
Copy Markdown

Strip surrounding whitespace from project_name before validating pending
Trusted Publisher forms, matching the existing workflow filename filter. A
pasted name such as example-name is accepted as example-name for all four
providers. Blank or internally spaced names are still rejected, and existing,
prohibited, similar, and standard-library project-name checks remain in place.

Fixes #20587.

The regressions exercise the real project-name service and PostgreSQL database,
including owner-only links for existing projects. Account publisher-management tests also
verify that each provider stores the trimmed name and uses it in the success
message and event. The translation catalog changes only update source locations.

Validation on Ubuntu 24.04 WSL2, Python 3.14.7, PostgreSQL 16.15, with the
repository's pinned test dependencies:

  • Original form suite: 125 passed.
  • Final regression tests against the original production code: 40 expected
    failures, 20 passing controls, no errors.
  • Forms and account/organization publisher-management tests after the fix:
    241 passed.
  • Changed common form module and new regression module: 100% statement/branch
    coverage. Ruff, ast-grep, and scoped mypy checks passed.

PostgreSQL 17.5 / the upstream Docker environment and the complete Warehouse
suite were not run. External account lookups are mocked; no live PyPI account
or publisher was changed.

Prepared with OpenAI Codex assistance for Youngseok Oh.

@YS-OH-CORE
YS-OH-CORE requested a review from a team as a code owner September 26, 2026 04:30

This branch has not been deployed

No deployments
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.

Pending publisher form: a leading space in the project name gives only "Invalid project name", twice

1 participant