andrewmusselman opened a new pull request, #1257: URL: https://github.com/apache/tooling-trusted-releases/pull/1257
## Allow editing project display name from the metadata tab Fixes #1254. Fixes #1256. Adds `display_name` as an editable field on `EditMetadataForm`, alongside the existing description, homepage, etc. Committee members and admins can now change a project's display name from the metadata tab. ### Changes - **`atr/shared/projects.py`** — extracts the display-name validation rules from `AddProjectForm.validate_display_name` into a module-level `_validate_display_name` helper, then calls it from both `AddProjectForm` and the new `display_name` field on `EditMetadataForm`. Validator is forgiving about the `Apache` prefix: users who type it out of habit (any case — `apache`, `APACHE`, `ApAcHe`) get it stripped and the canonical `Apache ` reapplied. Bare `Apache` alone is rejected; empty submission is rejected. - **`atr/storage/writers/project.py`** — `edit_metadata` applies `form.display_name` to `project.name`. - **`atr/get/projects.py`** — pre-populates the new field from `project.name`, stripping the `Apache ` prefix so the editable input shows just the suffix. - **`atr/form.py`** — `Widget.TEXT` now reads an optional `prefix` from the field's `json_schema_extra` and wraps the input in a Bootstrap `input-group` with the prefix as a non-editable static addon. Generic mechanism, used here for the `Apache` prefix on the project name field in both `AddProjectForm` and `EditMetadataForm`. - **`tests/unit/test_shared_projects.py`** — new file covering full-name input, suffix-only input (the new shape from the input-group UI), explicit Apache passthrough in any case, whitespace normalisation, empty and bare-Apache rejection, the regression cases from #1256, and the allow-list additions. ### Fixes #1256 (validator rejecting real Apache projects) The previous final "whole string must be alphanumeric (modulo a few punctuation chars)" check was redundant with the per-word case check above it and incorrectly rejected several `allowed_irregular_words` entries. The per-word check is sufficient because every regex restricts to alphanumerics, so any string that passes is already character-safe by construction. Also audited the validator against every TLP in the Whimsy registry. Two real Apache project names that previously failed are now covered by additions to `allowed_irregular_words`: - `Lucene.Net` (Whimsy capitalises it differently from the existing `Lucene.NET` allow-list entry; added both `Lucene.Net` and `Lucene.net` to cover all variants) - `(APR)` (for `Apache Portable Runtime (APR)`) Result: 210 / 210 active TLPs in Whimsy now pass. ### On @dave2wave's data integrity concern `Project.key` (primary key, used in every FK relationship) is untouched. `Project.name` is a non-key nullable string consumed only by the `display_name` / `short_display_name` properties. The API path `_apply_project_args_no_commit` already allowed updating `name`, so the storage layer is known-safe — this PR adds the UI surface. Historical references in already-sent emails or announcements naturally retain whatever name was in effect when they were generated. ### Not addressed here - `description` and `short_description` are accepted by `EditMetadataForm` but not yet persisted by `edit_metadata`. Pre-existing, tracked as #1252. ### Testing **`make unit`**: passes, including the new `tests/unit/test_shared_projects.py`. **`make check`**: passes. **`make e2e`**: 4 failed, 82 passed, 7 skipped, 28 errors. None of the failures or errors touch code modified by this PR — they are pre-existing on `main`. Failure pattern: - `admin/test_revoke_ssh_keys.py` and `admin/test_revoke_tokens.py` (4 failures): flash messages not appearing after revocation actions. Admin flow only. - `announce/*` and `vote/*` (28 errors): all the same fixture timeout — clicking "Send vote email" then waiting 30 s for navigation to `/vote/...`. Vote-start flow only. The one e2e test that touches project pages (`projects/test_get.py::test_archive_banner_*`) passes. Manual smoke test: edited a project display name in the dev server from the metadata tab; saw the h1 update and on projects page after save. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
