Skip to content

HARMONY-2372: resolve input and output files at once.#929

Merged
flamingbear merged 3 commits into
mainfrom
mhs/HARMONY-2372/resolve-input-and-output-files
Jun 29, 2026
Merged

HARMONY-2372: resolve input and output files at once.#929
flamingbear merged 3 commits into
mainfrom
mhs/HARMONY-2372/resolve-input-and-output-files

Conversation

@flamingbear

@flamingbear flamingbear commented Jun 25, 2026

Copy link
Copy Markdown
Member

Jira Issue ID

HARMONY-2372

Description

Combines inputFilesUrl and outputFilesUrl into a single accessFilesUrl link to resolve both input and output files.

Both sets of files are pageable independently (but to see it you'll probably need a batchee step and a wilimit

Local Test Steps

Pull this branch, run the tests, and deploy to Harmony-In-A-Box.

Make some requests and examine the steps endoint output.

Verify that there are single links now that are accessFilesUrl and that the links have &resolvefiles=true in them

If you're feeling lucky you can deploy Harmony-In-A-Box with: "harmonyservices/query-cmr:latest","podaac/l2ss-py:sit","nasa/batchee:latest","nasa/stitchee:latest",podaac/concise:sit",

run this 20 element request.
http://localhost:3000/C1254854453-LARC_CLOUD/ogc-api-coverages/1.0.0/collections/all/coverage/rangeset?subset=lat(-70%3A30)&subset=lon(-157.5%3A-10)&concatenate=true&maxResults=20&extend=true&serviceId=l2-subsetter-batchee-stitchee-concise

Access the batchee files via the link /steps?workitem={batchee}&resolvefiles=true
check paging for in and output files works by adding a wilimit /steps?workitem={batchee}&resolvefiles=true&wilimit=3
you can add another workitem to make sure more than one still works as well. /steps?workitem={querycmrWid},{batcheeWid}&resolvefiles=true&wilimit=3

PR Acceptance Checklist

  • Acceptance criteria met
  • Tests added/updated (if needed) and passing
  • Documentation updated (if needed)
  • Harmony in a Box tested (if changes made to microservices or new dependencies added)

Summary by CodeRabbit

  • Bug Fixes
    • Updated the Steps API “resolve files” behavior to use a single accessFilesUrl link in overview mode.
    • When resolving is enabled, the API now inlines both inputFiles and outputFiles together, with updated paging included where applicable.
    • Updated query handling for resolveFiles to use resolveFiles=true, with stricter single-value validation.
  • Documentation
    • Refreshed the Steps API documentation to reflect the new accessFilesUrl and resolveFiles=true flow.
  • Tests
    • Updated job/steps test coverage and assertions for the new response shape and validation rules.

@coderabbitai

coderabbitai Bot commented Jun 25, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: a06eb2e1-6241-4cab-9ad8-696e4f7e793a

📥 Commits

Reviewing files that changed from the base of the PR and between 7d0a554 and 181786d.

📒 Files selected for processing (1)
  • services/harmony/app/frontends/steps.ts
🚧 Files skipped from review as they are similar to previous changes (1)
  • services/harmony/app/frontends/steps.ts

📝 Walkthrough

Walkthrough

Updates the Steps API so resolveFiles is a boolean that inlines both input and output file pages for requested work items, replaces separate file-link fields with accessFilesUrl, and adjusts docs and tests to match the new response and validation behavior.

Changes

Steps API resolveFiles update

Layer / File(s) Summary
Boolean resolveFiles contract
services/harmony/app/frontends/steps.ts, services/harmony/app/markdown/steps.md
resolveFiles becomes a boolean query flag, request parsing maps invalid values to validation errors, and the API docs switch to accessFilesUrl plus resolveFiles=true descriptions.
Resolved-file data model
services/harmony/app/frontends/steps.ts
The resolved-files map stores both input and output pages per work item, inline file links are generated with resolvefiles=true, and the GET handler resolves both file sets when requested.
Steps endpoint test updates
services/harmony/test/jobs/jobs-steps.ts
The steps tests switch to resolveFiles: true, assert accessFilesUrl, cover multi-work-item inline resolution, and update paging and validation expectations.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~45 minutes

Possibly related PRs

  • nasa/harmony#923: Changes the same Steps API file-resolution path and response fields around resolveFiles.
  • nasa/harmony#925: Also updates /jobs/:jobID/steps handling for multiple work items and file-resolution queries.

Suggested reviewers

  • indiejames
  • ygliuvt
  • chris-durbin

Poem

🐇 I hopped through the Steps API glow,
With resolveFiles=true in tow.
accessFilesUrl led the chase,
While input and output shared one place,
And paging bounced along the flow.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title clearly summarizes the main change: resolving input and output files together.
Description check ✅ Passed The description follows the template and includes the Jira ID, description, test steps, and checklist.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch mhs/HARMONY-2372/resolve-input-and-output-files

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@flamingbear flamingbear marked this pull request as ready for review June 25, 2026 19:09

@coderabbitai coderabbitai Bot 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.

Actionable comments posted: 1

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@services/harmony/app/frontends/steps.ts`:
- Around line 125-132: The resolveFiles query handling in steps.ts should
normalize the incoming value before calling parseBoolean, since
query.resolvefiles can be a string[] when the parameter is repeated. Update the
logic in the resolveFiles parsing block to detect and reject/handle multi-valued
inputs consistently, and only pass a single normalized string into parseBoolean
so repeated params and empty values don’t bypass RequestValidationError handling
or fall through as a raw runtime error. Keep the fix localized to the
resolveFiles branch and preserve the existing
ParameterParseError-to-RequestValidationError conversion in the same try/catch
path.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 1c2d14ef-bd06-47fc-a26b-c73c25ce2f98

📥 Commits

Reviewing files that changed from the base of the PR and between b7fbd0a and 7d0a554.

📒 Files selected for processing (3)
  • services/harmony/app/frontends/steps.ts
  • services/harmony/app/markdown/steps.md
  • services/harmony/test/jobs/jobs-steps.ts

Comment thread services/harmony/app/frontends/steps.ts
Comment thread services/harmony/app/frontends/steps.ts Outdated
// Map of workItem id -> its resolved page of files
type ResolvedFiles = Map<number, WiResolvedFiles>;
// A single workItem's resolved page of input and output files
interface WiAccessFiles {

@indiejames indiejames Jun 29, 2026

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.

nit: I probably would rename this to WorkItemAccessFiles

@flamingbear flamingbear merged commit ee7da1e into main Jun 29, 2026
6 checks passed
@flamingbear flamingbear deleted the mhs/HARMONY-2372/resolve-input-and-output-files branch June 29, 2026 15:53
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