Skip to content

Release command cleanup - #340

Merged
tech3371 merged 4 commits into
IMAP-Science-Operations-Center:mainfrom
tech3371:release-cleanup
Jul 24, 2026
Merged

Release command cleanup#340
tech3371 merged 4 commits into
IMAP-Science-Operations-Center:mainfrom
tech3371:release-cleanup

Conversation

@tech3371

Copy link
Copy Markdown
Contributor

Change Summary

Overview

cleaning up command for release to line up latest changes in sds-.. repo. Tested in dev that these changes works with that change.

File changes

Testing

@tech3371 tech3371 self-assigned this Jul 24, 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 PR refactors the “release” flow to align with an updated archive API contract by switching from instrument/date/release-number based parameters to a manifest-file driven release request, and updates the CLI and tests accordingly.

Changes:

  • Updated io.release() to require release_type + manifest_file, upload the manifest, then call the /release endpoint with the manifest basename.
  • Simplified the CLI release subcommand by removing instrument/date/release-number/exclude-file flags and updating help text.
  • Updated unit tests to create a temp manifest file and assert the expected 3-request sequence (upload GET, S3 PUT, release GET).

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.

File Description
imap_data_access/io.py Refactors release() signature/validation and implements manifest upload + /release request based on manifest basename.
imap_data_access/cli.py Simplifies release subcommand arguments/help to match the new manifest-based release flow.
tests/test_io.py Updates release tests to exercise the new manifest upload + release request sequence and removes obsolete parameter-based tests.
Comments suppressed due to low confidence (6)

imap_data_access/io.py:591

  • The docstring lists 'early-release' and 'unrelease' as supported release types, but the function currently raises for both as "Not supported yet". The docstring should reflect that these types are not supported.
        - 'early-release': Early release of selected files approved by both
          instrument and project.
        - 'unrelease': Unrelease previously released files due to various
          causes and reasons.

imap_data_access/io.py:593

  • The docstring type for manifest_file says str, but the function takes a Path (and the CLI passes a string path). Update the docstring to match the accepted path-like inputs.
    manifest_file : str
        Path to manifest file containing specification.

imap_data_access/io.py:609

  • The current manifest_file is None check doesn't actually validate that the path is valid, despite the error message implying it does. Consider normalizing to Path and checking is_file() so users get a clear, early error instead of a later FileNotFoundError/IsADirectoryError during upload.
    if manifest_file is None:
        raise ValueError("Manifest file is required or check that the path is valid.")

imap_data_access/io.py:631

  • Since manifest_file is normalized to a Path, manifest_file.name is clearer than os.path.basename(...) and avoids implicit path-to-str coercion.
        "manifest_file": os.path.basename(manifest_file),

imap_data_access/io.py:618

  • Behavior for unsupported release_type values (currently early-release/unrelease) is new/changed here but there is no test asserting the expected error. Adding a small parametrized test would prevent regressions.
    if release_type in [ReleaseType.EARLY_RELEASE.value, ReleaseType.UNRELEASE.value]:
        raise ValueError("Not supported yet")

imap_data_access/cli.py:757

  • --manifest-file is currently optional (defaulting to None), but _release_parser always passes it through and io.release() then errors at runtime. Making it required in argparse will give users an immediate, standard CLI error message and help text.
        type=str,
        required=False,
        metavar="PATH",
        default=None,
        help=(

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread imap_data_access/io.py Outdated
Comment thread imap_data_access/io.py
Comment thread imap_data_access/io.py Outdated
Comment thread imap_data_access/cli.py
Comment thread imap_data_access/io.py

@tmplummer tmplummer left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

LGTM

@tech3371
tech3371 merged commit 4bc35de into IMAP-Science-Operations-Center:main Jul 24, 2026
16 checks passed
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.

3 participants