Skip to content

NCC-28 Fixing when to freeze dataset, if the dataset is not submitted… - #3

Merged
sedv8808 merged 1 commit into
mainfrom
dev/ghactions
Aug 18, 2026
Merged

NCC-28 Fixing when to freeze dataset, if the dataset is not submitted…#3
sedv8808 merged 1 commit into
mainfrom
dev/ghactions

Conversation

@sedv8808

Copy link
Copy Markdown
Contributor

… yet, do not freeze. wait until it is fully submitted. otherwise, we risk minting a stale version

This pull request improves how the code checks for dataset submission readiness before minting a DOI, ensuring that a DOI is only minted for datasets that have actually been submitted. The changes refactor and centralize the logic for handling submission dates, and clarify the intent behind the DatasetNotReady exception.

Readiness and submission date handling:

  • Added a new _submission_dates() method to neotomaDOI.py that parses and returns all submission dates in order, raising DatasetNotReady if none are found. This centralizes the logic and makes it reusable.
  • Updated mint_doi() to call _submission_dates() before freezing data, ensuring that only datasets that have actually been submitted are frozen and minted. This prevents permanently attaching a stale snapshot to a DOI.
  • Removed duplicate submission date parsing logic from mint_doi(), replacing it with the new method.

Exception clarity:

  • Added a comment and # noqa: N818 to the DatasetNotReady exception in exceptions.py to clarify that it intentionally does not use the Error suffix, as it indicates a normal, temporary state rather than an error.

… yet, do not freeze. wait until it is fully submitted. otherwise, we risk minting a stale version
Copilot AI lite review requested due to automatic review settings August 18, 2026 21:38
@sedv8808
sedv8808 merged commit b71e419 into main Aug 18, 2026

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request adjusts DOI minting readiness checks so datasets are only frozen/minted after they’ve actually been submitted, preventing write-once “frozen” snapshots from being taken too early.

Changes:

  • Centralizes submission-date parsing into neotomaDOI._submission_dates() and uses it to gate freezing/minting.
  • Moves the submission-readiness check earlier in mint_doi() (before freeze_data()).
  • Clarifies the intent of DatasetNotReady and silences N818 naming lint with an explicit rationale.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
src/neotomadoi/neotomaDOI.py Adds _submission_dates() and ensures readiness is checked before freezing data during mint_doi().
src/neotomadoi/exceptions.py Documents why DatasetNotReady intentionally lacks an Error suffix and applies # noqa: N818.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment on lines +296 to +300
submitted = [
datetime.strptime(i.get("date"), "%Y-%m-%d")
for i in self.data.get("dates")
if i.get("dateType") == "Submitted"
]
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