asf-tooling commented on issue #1201:
URL:
https://github.com/apache/tooling-trusted-releases/issues/1201#issuecomment-4409699528
<!-- gofannon-issue-triage-bot v2 -->
**Automated triage** — analyzed at `main@2da7807a`
**Type:** `new_feature` • **Classification:** `actionable` •
**Confidence:** `medium`
**Application domain(s):** `release_lifecycle`,
`project_committee_management`, `shared_infrastructure`
### Summary
The issue reports that the project settings page is hard to find from phase
pages (compose, vote, finish). The link text "About this project" on the index
page is misleading since it goes to the settings page. @sbp agreed to add links
on each stage page, @dave2wave elaborated that links on phase pages should
anchor to the relevant section on the project settings/policy page.
@dave2wave's latest comment (May 8) suggests that in phase-page context, the
user wants to see the release candidate's copy of the project policy. The
immediate fix involves renaming the link and adding anchor IDs to policy
sections.
### Where this lives in the code today
#### `atr/get/projects.py` — `_render_compose_form` (lines 338-342)
_needs modification_
The compose policy card lacks an HTML ID needed for anchor linking from the
compose phase page.
```python
async def _render_compose_form(project: sql.Project) -> htm.Element:
card = htm.Block(htm.div, classes=".card.mb-4")
card.div(".card-header.bg-light.d-flex.justify-content-between.align-items-center")[
htm.h3(".mb-0")["Release policy - Compose options"]
]
```
#### `atr/get/projects.py` — `_render_vote_form` (lines 639-643)
_needs modification_
The vote policy card lacks an HTML ID needed for anchor linking from the
vote phase page.
```python
async def _render_vote_form(project: sql.Project) -> htm.Element:
card = htm.Block(htm.div, classes=".card.mb-4")
card.div(".card-header.bg-light.d-flex.justify-content-between.align-items-center")[
htm.h3(".mb-0")["Release policy - Vote options"]
]
```
#### `atr/get/projects.py` — `_render_finish_form` (lines 396-400)
_needs modification_
The finish policy card lacks an HTML ID needed for anchor linking from the
finish phase page.
```python
async def _render_finish_form(project: sql.Project) -> htm.Element:
card = htm.Block(htm.div, classes=".card.mb-4")
card.div(".card-header.bg-light.d-flex.justify-content-between.align-items-center")[
htm.h3(".mb-0")["Release policy - Finish options"]
]
```
#### `atr/get/projects.py` — `view` (lines 151-156)
_currently does this_
The project settings/view page that users are having trouble finding from
phase pages.
```python
async def view(
session: web.Committer, _projects: Literal["projects"], project_key:
safe.ProjectKey
) -> web.WerkzeugResponse | str:
"""
URL: /projects/<project_key>
"""
```
### Where new code would go
- `atr/get/compose.py` — template render call or page construction
A link to project settings (anchored to #compose-policy) needs to be added
to the compose phase page.
- `atr/get/vote.py` — template render call or page construction
A link to project settings (anchored to #vote-policy) needs to be added to
the vote phase page.
- `atr/get/finish.py` — template render call or page construction
A link to project settings (anchored to #finish-policy) needs to be added
to the finish phase page.
### Proposed approach
The fix has two parts. First, rename the "About this project" link to
"Project settings" in the committer index page template, so the intent of the
link is clearer. Second, add HTML ID anchors to each policy section card on the
project settings page (`_render_compose_form`, `_render_vote_form`,
`_render_finish_form`) so that phase pages can deep-link directly to the
relevant policy section.
The third part (adding links on compose/vote/finish pages themselves)
requires access to those page templates or construction code, which I don't
have in the provided source. However, the pattern would be to add a small link
like "⚙ Project settings" near the top of each phase page, pointing to
`/projects/<project_key>#compose-policy` (or `#vote-policy`, `#finish-policy`
respectively). @dave2wave's latest comment about showing the RC's copy of the
policy may represent a deeper feature that goes beyond simple link additions,
and could be addressed separately.
### Suggested patches
#### `atr/templates/index-committer.html`
Rename 'About this project' to 'Project settings' to make the link's purpose
clearer.
````diff
--- a/atr/templates/index-committer.html
+++ b/atr/templates/index-committer.html
@@ -87,7 +87,7 @@
<p class="mb-3">
<a href="{{ as_url(get.projects.view, project_key=project.key )}}"
- class="text-decoration-none me-2">About this project</a>
+ class="text-decoration-none me-2">Project settings</a>
{% if project.committee.key in current_user.committees %}
<span class="text-muted me-2">/</span>
<a href="{{ as_url(get.projects.add_project,
committee_key=project.committee.key) }}"
````
#### `atr/get/projects.py`
Add HTML IDs to policy section cards so phase pages can anchor-link to the
relevant section.
````diff
--- a/atr/get/projects.py
+++ b/atr/get/projects.py
@@ -230,7 +230,7 @@
async def _render_compose_form(project: sql.Project) -> htm.Element:
- card = htm.Block(htm.div, classes=".card.mb-4")
+ card = htm.Block(htm.div, classes="#compose-policy.card.mb-4")
card.div(".card-header.bg-light.d-flex.justify-content-between.align-items-center")[
htm.h3(".mb-0")["Release policy - Compose options"]
]
@@ -275,7 +275,7 @@
async def _render_finish_form(project: sql.Project) -> htm.Element:
- card = htm.Block(htm.div, classes=".card.mb-4")
+ card = htm.Block(htm.div, classes="#finish-policy.card.mb-4")
card.div(".card-header.bg-light.d-flex.justify-content-between.align-items-center")[
htm.h3(".mb-0")["Release policy - Finish options"]
]
@@ -383,7 +383,7 @@
async def _render_vote_form(project: sql.Project) -> htm.Element:
- card = htm.Block(htm.div, classes=".card.mb-4")
+ card = htm.Block(htm.div, classes="#vote-policy.card.mb-4")
card.div(".card-header.bg-light.d-flex.justify-content-between.align-items-center")[
htm.h3(".mb-0")["Release policy - Vote options"]
]
````
### Open questions
- Does htm.Block's `classes` parameter support the `#id.class` CSS selector
syntax, or does the ID need to be added differently (e.g., via a separate `id`
parameter or htpy attribute)?
- What do the compose, vote, and finish phase page templates/code look like?
Links to project settings need to be added there.
- @dave2wave's latest comment suggests showing the RC's copy of the project
policy on phase pages. Is this a separate feature from just adding links, or
does it supersede the linking approach?
- Should a disclaimer be added about defaults working in most cases (per
@sbp's comment), and if so where?
### Files examined
- `atr/get/projects.py`
- `atr/post/projects.py`
- `atr/shared/projects.py`
- `atr/templates/projects.html`
- `atr/get/root.py`
- `atr/templates/index-committer.html`
- `atr/storage/writers/project.py`
- `tests/e2e/policy/conftest.py`
---
*Draft from a triage agent. A human reviewer should validate before merging
any change. The agent did not run tests or verify diffs apply.*
--
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]