Skip to content

fix(grz-cli): Submission id upload tracking#556

Merged
tedil merged 9 commits into
mainfrom
fix/submission-id-upload-tracking
May 8, 2026
Merged

fix(grz-cli): Submission id upload tracking#556
tedil merged 9 commits into
mainfrom
fix/submission-id-upload-tracking

Conversation

@virag-compbio

Copy link
Copy Markdown
Collaborator

Previously, the upload worker would skip uploading a file if there was a cached 'upload_successful' state, even if the cached state was from a completely different submission ID.
This change adds the 'submission_id' to the cache, ensuring that files are properly re-uploaded for new submissions.

@virag-compbio virag-compbio requested a review from Hoeze May 4, 2026 11:40
@virag-compbio virag-compbio marked this pull request as draft May 4, 2026 11:45
@virag-compbio virag-compbio changed the title fix(grz-cli)/submission-id-upload-tracking fix(grz-cli):submission-id-upload-tracking May 4, 2026
@virag-compbio virag-compbio changed the title fix(grz-cli):submission-id-upload-tracking fix(grz-cli): Submission id upload tracking May 4, 2026
Comment thread packages/grz-common/src/grz_common/progress/states.py Outdated
@virag-compbio virag-compbio force-pushed the fix/submission-id-upload-tracking branch from d1a2126 to 5193ec8 Compare May 5, 2026 13:12
@virag-compbio virag-compbio requested a review from tedil May 5, 2026 13:26
@virag-compbio virag-compbio marked this pull request as ready for review May 5, 2026 13:34

@tedil tedil 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.

Now that we have submission_id in the base State class, should we include the submission_id (and the checks for that) in all of the progress logs for consistent behaviour?

@virag-compbio virag-compbio force-pushed the fix/submission-id-upload-tracking branch from c79c964 to 2eab697 Compare May 5, 2026 22:05
Virag Sharma and others added 6 commits May 6, 2026 00:13
Include submission_id in UploadState when setting upload success/failure
Add submission_id mismatch check to determine if reupload is needed
Improve log message to include submission_id for already uploaded files
@virag-compbio virag-compbio force-pushed the fix/submission-id-upload-tracking branch from 2eab697 to 8cfe3f1 Compare May 5, 2026 22:59
@virag-compbio virag-compbio requested a review from tedil May 6, 2026 06:27

@tedil tedil 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.

I think this is missing some submission_id writing/reading in some of the states/checks, please ensure the submission_id is passed to every ValidationState, DecryptionState etc., and that it is also checked for during the respective checks / progress updates.
I also recommend having a test that checks that e.g., validation on an "unseeded" file works (logger.get_state(...).get("submission_id") == expected_id), the current manual "seeding" (aka injection) seems a bit odd to me

Comment thread packages/grz-common/src/grz_common/workers/upload.py Outdated
@virag-compbio virag-compbio force-pushed the fix/submission-id-upload-tracking branch from 67a7e1c to db72e71 Compare May 8, 2026 09:17
@virag-compbio virag-compbio requested a review from tedil May 8, 2026 09:25

@tedil tedil 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.

Very nice, thank you!

@tedil tedil added this pull request to the merge queue May 8, 2026
Merged via the queue into main with commit 66d185a May 8, 2026
11 checks passed
@tedil tedil deleted the fix/submission-id-upload-tracking branch May 8, 2026 10:38
virag-compbio added a commit that referenced this pull request May 11, 2026
Previously, the upload worker would skip uploading a file if there was a
cached 'upload_successful' state, even if the cached state was from a
completely different submission ID.
This change adds the 'submission_id' to the cache, ensuring that files
are properly re-uploaded for new submissions.

---------

Co-authored-by: Virag Sharma <viragsharma@w620-mb006-wl.local>
Co-authored-by: Virag Sharma <viragsharma@w620-mb006-wl.speedport.ip>
github-merge-queue Bot pushed a commit that referenced this pull request May 12, 2026
## grz-tools release (2026-05-11)

This release updates multiple packages in the `grz-tools` monorepo. See
the full changelog and per-package details linked below.

### Versions
- `grzctl` `2.0.0` (from `1.4.0`)
- `grz-db` `2.0.0` (from `1.2.0`)
- `grz-common` `2.0.0` (from `1.6.1`)
- `grz-cli` `1.6.0` (from `1.5.1`)
- `grz-pydantic-models` `2.6.0` (from `2.5.0`)
- `grz-check` `0.3.0` (from `0.2.1`)

---

## ⚠️ Breaking / behavior changes

- `grzctl` now automatically updates submission state in the DB on
subcommand invocation (default `--update-db`; use `--no-update-db` to
disable). The DB state enum adds `REPORTING`. (#501)
- `grzctl pruefbericht submit` now requires `--submission-id` so the
submission can be updated consistently in the DB. (#525)
- `grz-cli` enforces a version policy via S3 `version.json` for `upload`
/ `submit` operations. (#477)
- Added `selected_for_qc` column and QC workflow version recording;
tools now require/record QC workflow version and log `grzctl` runtime
version. (#531, #561)
- `grzctl db submission populate-qc` now requires
`--qc-workflow-version` (or `GRZCTL_QC_WORKFLOW_VERSION`) to be provided
so the QC workflow version can be recorded in the DB. (#561)
- `grzctl` introduces `backfill` to re-read metadata from archives and
other state/reporting improvements (impacting automation that
reads/writes the submission DB). (#559)
- Dropped the Python dependency `pysam` from `grz-cli`, `grzctl`, and
`grz-common` (installs are lighter; environments that relied on it being
installed transitively must install it explicitly). (#565)

---

## Highlights

### grz-cli (`1.6.0`)
- Version policy checks for `upload` and `submit` via S3 `version.json`
(#477)
- Multiple config files are merged into one effective configuration
(#490)
- `upload` now prints the generated submission ID to stdout (can affect
scripts that parse command output). (#556)

### grzctl (`2.0.0`)
- `db list`: state-based filtering, with “latest” view by default (#523)
- `db submission show`: `--json` output (#510)
- Prüfbericht generation using submission ID from database (#525)
- `report`: makes `identifiers.le` optional (#488)
- `report` supports `--with-submission-ids`. (#539)
- Improved redaction during archival. (#517)
- Add `selected_for_qc` column to the submission database (#531)
- `populate-qc`: accept `THRESHOLD NOT MET` as valid QC status (#529)
- Fix displayed QC stats (#508)
- Introduce `backfill` to re-read metadata from the archive (#559)
- Require and record QC workflow version; log `grzctl` runtime versions
(#561)
- `db tui`: add `--quarter`/`--year` selection for the “Detailed QC by
LE” overview. (#541)

### grz-pydantic-models (`2.6.0`)
- Enforce differing checksums for sequencing data (#496)
- Fix MII consent period to use datetime instead of date (#491)
- Change `minReadLength` default from `0` to `-1` (#506)

### grz-check (`0.3.0`)
- Python bindings now power checksum validation across the stack (#554)
- Checksum calculation is now exposed correctly in the Python API
(#5dce167)
- `grz-check` is now built and published as a Python package via
`pyproject.toml`/maturin. (#543)

### Maintenance
- Dependency updates (#498)
- Python crypto dependency updates: `pynacl` and `crypt4gh`

---

## Rollout notes (ops)
- Apply the submission DB migrations before using this release. The
schema changes include `selected_for_qc`, QC workflow version logging,
`grzctl` runtime version logging, and the new `REPORTING` state.
- Submission DB migrations in this release also include the `qc_queue`
table and additional `submissions` fields (`submission_size`,
`submission_metadata`)—make sure your DB is migrated to `head` before
running the updated tools.
- Update any automation that calls `grzctl pruefbericht submit` to pass
`--submission-id`.
- If you enforce LE uploads via S3, deploy the `version.json` policy for
`grz-cli`.
- Deploy the matching `grz-check` Python bindings where Python-based
checksum validation is used.

---

## Full details
- Full changelog: [changes.md](changes.md)  
- Per-package changelogs:
  - [packages/grz-cli/CHANGELOG.md](packages/grz-cli/CHANGELOG.md)
  - [packages/grzctl/CHANGELOG.md](packages/grzctl/CHANGELOG.md)
  - [packages/grz-common/CHANGELOG.md](packages/grz-common/CHANGELOG.md)
  - [packages/grz-db/CHANGELOG.md](packages/grz-db/CHANGELOG.md)
-
[packages/grz-pydantic-models/CHANGELOG.md](packages/grz-pydantic-models/CHANGELOG.md)
  - [packages/grz-check/CHANGELOG.md](packages/grz-check/CHANGELOG.md)
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.

2 participants