Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactored JobState to have shorter names #2556

Merged
merged 3 commits into from
Feb 7, 2024

Conversation

dfitchett
Copy link
Contributor

@dfitchett dfitchett commented Feb 6, 2024

What was the problem?

JobStates were very long.

How does this fix it?1

JobState names will be shorter, resulting in shorter metric names, log statements, and db entries.

Stacked on PR

How to test this PR

  • pull code
  • Unit Test:
    • from /domain-ee/ee-ep-merge-app run pytest
  • Integration Tests:
    • run base platform
    • from /domain-ee/ee-ep-merge-app run pytest ./integration
  • End to End tests:
    • run this CI action to verify successful integration test
    • run end to end tests locally:
      • export BIP_CLAIM_URL=mock-bip-claims-api:20300
      • run bgs and bip services and mocks:
        • COMPOSE_PROFILES="bip,bgs" ./gradlew :app:dockerComposeUp
        • COMPOSE_PROFILES="bip,bgs" ./gradlew -p mocks :dockerComposeUp
      • ./gradlew :domain-ee:ee-ep-merge-app:endToEndTest

Footnotes

  1. Pull-Requests guidelines. If PR is significant, update Current Software State wiki page.

@dfitchett dfitchett requested a review from a team as a code owner February 6, 2024 20:16
Copy link
Contributor

@nanotone nanotone left a comment

Choose a reason for hiding this comment

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

LGTM!

SET_TEMP_STATION_OF_JURISDICTION_FAILED_REMOVE_SPECIAL_ISSUE = 'SET_TEMP_STATION_OF_JURISDICTION_FAILED_REMOVE_SPECIAL_ISSUE'
MOVE_CONTENTIONS_FAILED_REMOVE_SPECIAL_ISSUE = 'MOVE_CONTENTIONS_FAILED_REMOVE_SPECIAL_ISSUE'
MOVE_CONTENTIONS_FAILED_REVERT_TEMP_STATION_OF_JURISDICTION = 'MOVE_CONTENTIONS_FAILED_REVERT_TEMP_STATION_OF_JURISDICTION'
CANCEL_CLAIM_FAILED_REVERT_TEMP_STATION_OF_JURISDICTION = 'CANCEL_CLAIM_FAILED_REVERT_TEMP_STATION_OF_JURISDICTION'
Copy link
Contributor

Choose a reason for hiding this comment

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

This is so Java-ish but, then again, DRYing it up won't actually reduce the LoC count.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry can't help myself! 😆

@dfitchett dfitchett requested a review from nanotone February 6, 2024 23:03
@dfitchett dfitchett force-pushed the dfitchett/ep-merge/refactor-job-states branch from 9056674 to 08d9aae Compare February 7, 2024 00:13
Copy link
Contributor

@nanotone nanotone left a comment

Choose a reason for hiding this comment

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

👍

"""
Uses the name as the automatic value, rather than an integer

See https://docs.python.org/3/library/enum.html#using-automatic-values for reference
Copy link
Contributor

Choose a reason for hiding this comment

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

Cute!

Yeah, this is a neat trick. This URL doesn't have the fragment for me though; https://docs.python.org/3/howto/enum.html#using-automatic-values is the one for me. 🤷

Base automatically changed from dfitchett/ep-merge/black-formatter to develop February 7, 2024 19:48
@dfitchett dfitchett force-pushed the dfitchett/ep-merge/refactor-job-states branch from 49652c2 to 9cf7642 Compare February 7, 2024 19:51
@msnwatson msnwatson merged commit 3858260 into develop Feb 7, 2024
@msnwatson msnwatson deleted the dfitchett/ep-merge/refactor-job-states branch February 7, 2024 19:52
msnwatson pushed a commit that referenced this pull request Feb 15, 2024
* Refactored JobState to have shorter names

* Fixed DRY code smell

* Fixed url
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.

4 participants