sbp commented on issue #963:
URL:
https://github.com/apache/tooling-trusted-releases/issues/963#issuecomment-4172526288
The `release_ready_for_vote` function calls:
```python
release = await session.release(
project_key,
version_key,
data=data,
with_project=True,
with_committee=True,
with_project_release_policy=True,
)
```
Notice no `phase` argument, so it's using the default:
```
async def release(
self,
project_key: safe.ProjectKey,
version_key: safe.VersionKey,
phase: sql.ReleasePhase | db.NotSet | None = db.NOT_SET,
[...]
if phase is None:
phase_value = db.NOT_SET
elif phase is db.NOT_SET:
phase_value = sql.ReleasePhase.RELEASE_CANDIDATE_DRAFT
else:
phase_value = phase
```
Which is `sql.ReleasePhase.RELEASE_CANDIDATE_DRAFT`.
Both manual and regular votes use `release_ready_for_vote`, as the audit
tool already observes, so both have that phase check. Even if the check were
not done there, the storage interface in
`atr.storage.writers.release.CommitteeParticipant.promote_to_candidate` also
has a phase check:
```python
# Verify that it's in the correct phase
if release_for_pre_checks.phase !=
sql.ReleasePhase.RELEASE_CANDIDATE_DRAFT:
return "This release is not in the candidate draft phase"
```
And, in addition, its update only takes effect on drafts:
```python
sqlmodel.update(sql.Release)
.where(
via(sql.Release.key) == release_for_pre_checks.key,
via(sql.Release.phase) ==
sql.ReleasePhase.RELEASE_CANDIDATE_DRAFT,
sql.latest_revision_number_query() ==
str(selected_revision_number),
)
```
--
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]