Skip to content

Conversation

@ehanson8
Copy link
Contributor

@ehanson8 ehanson8 commented Feb 4, 2025

Purpose and background context

Refactor CLI commands and Workflow class attributes and properties to improve the clarity of the application

Includes new or updated dependencies?

YES

Changes expectations for external applications?

NO

Developer

  • All new ENV is documented in README
  • All new ENV has been added to staging and production environments
  • All related Jira tickets are linked in commit message(s)
  • Stakeholder approval has been confirmed (or is not needed)

Code Reviewer(s)

  • The commit message is clear and follows our guidelines (not just this PR message)
  • There are appropriate tests covering any new functionality
  • The provided documentation is sufficient for understanding any new functionality introduced
  • Any manual tests have been performed or provided examples verified
  • New dependencies are appropriate or there were no changes

Why these changes are being introduced:
* Refactor CLI options so that each CLI command only receives the necessary parameters.

How this addresses that need:
* Update CLI commands to only add necessary parameters for each command
* Refactor Workflow class to only require batch_id for instantiation
* Create metadata_mapping_path, s3_bucket, and output_queue properties
* Refactor collection_handle and email_recipients as method args
* Update workflow fixtures to account for new class properties
* Update CLI tests to account for shifting CLI options
* Update outdated values in Workflow class unit tests and
* Remove unnecessary Workflow class unit test after class attributes are removed

Side effects of this change:
* None
@ehanson8 ehanson8 requested review from a team, ghukill and jonavellecuerdo February 4, 2025 22:17
Copy link

@ghukill ghukill left a comment

Choose a reason for hiding this comment

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

Other than a question about the accuracy of --email-recipients being an override, it looks great!

One more suggestion, but not required, would be to add the CLI --help output to the README. I have a feeling this is somewhat contreversial as a practice, but I find it pretty helpful.

I think painting a picture of the CLI interface in the README users unfamiliar with the application, but also can surface potetially rough edges during development.

For example, I left my comment about --batch-id after running pipenv run dsc --help and observing the output. Yes, I could have caught it in the click CLI code itself... but I missed it there at first.

But totally optional, and could wait.

@coveralls
Copy link

coveralls commented Feb 5, 2025

Pull Request Test Coverage Report for Build 13162662894

Details

  • 34 of 40 (85.0%) changed or added relevant lines in 4 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage decreased (-1.2%) to 98.542%

Changes Missing Coverage Covered Lines Changed/Added Lines %
dsc/workflows/demo.py 6 9 66.67%
dsc/workflows/sccs.py 6 9 66.67%
Totals Coverage Status
Change from base Build 13080178348: -1.2%
Covered Lines: 473
Relevant Lines: 480

💛 - Coveralls

Copy link
Contributor

@jonavellecuerdo jonavellecuerdo left a comment

Choose a reason for hiding this comment

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

This is looking really awesome! I agree with @ghukill 's suggestions for updated CLI descriptions.

Also, I can't recall why we created the Demo workflow. If still needed, can you add the @property methods, or if no longer needed, let's remove the following:

  • dsc/workflows/demo.py
  • dsc/workflows/metadata_mapping/demo.json

Comment on lines +22 to +24
@property
def output_queue(self) -> str:
return "awaiting AWS infrastructure"
Copy link
Contributor

Choose a reason for hiding this comment

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

[Non-blocking] Since we are planning to create an output queue for every workflow, this might resemble something like dss-sccs-output, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

You are very likely correct but I think we'll need a PR for updating these values once the AWS infra is done so I'd rather not guess until they've been created

@ehanson8
Copy link
Contributor Author

ehanson8 commented Feb 5, 2025

@ghukill I will add that to this ticket for updating README.md

* Update parameter docstrings for great accuracy
* Add properties to temporary Demo workflow class
@ehanson8 ehanson8 merged commit eac2eff into main Feb 5, 2025
2 checks passed
@ehanson8 ehanson8 deleted the refactor-cli-options branch February 5, 2025 18:11
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.

5 participants