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

In 1065 maintenance 09 2024 #272

Merged
merged 2 commits into from
Sep 19, 2024
Merged

Conversation

jonavellecuerdo
Copy link
Contributor

Purpose and background context

Update app according to DataEng Application Maintenance.

The major updates for this work include:

  • Bumping Python version from 3.11 to 3.12
  • Creating a Config class to support dynamic access to environment variables
  • Updating AlmaClient to use Config class (and deprecating config.load_alma_config
    Note: I opted for minimal updates and didn't convert the class to attrs hence the use of @property methods for the class attributes that relied on access to env variables via Config.
  • Updating configure_logger to use verbose boolean flag
    • This resulted in deprecation of -l/--log-level CLI option and updating CLI to use -v/--verbose CLI option instead.
      Note: The ECS task definition in Prod currently sets LOG_LEVEL. This will not cause an issue as Config().LOG_LEVEL is not called anywhere in the application, but nothing that we'd need to ask InfraEng to update the Terraform docs to remove this env variable.

How can a reviewer manually see the effects of these changes?

Run make test and verify all unit tests are passing.

Includes new or updated dependencies?

YES

Changes expectations for external applications?

NO

What are the relevant tickets?

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 and verified
  • New dependencies are appropriate or there were no changes

@coveralls
Copy link

coveralls commented Sep 18, 2024

Pull Request Test Coverage Report for Build 10946501804

Details

  • 40 of 40 (100.0%) changed or added relevant lines in 4 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 100.0%

Totals Coverage Status
Change from base Build 9117349309: 0.0%
Covered Lines: 203
Relevant Lines: 203

💛 - Coveralls

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.

Changes look good to me! Thanks for the detailed PR, easy to follow along the changes.

I'm happy to approve -- tests and linting passes locally -- but @jonavellecuerdo it might be worth tagging Adam S. as a reviewer on this PR as well. He's likely in a better condition to perform any manual tests (if possible).

@ehanson8
Copy link
Contributor

Changes look good to me! Thanks for the detailed PR, easy to follow along the changes.

I'm happy to approve -- tests and linting passes locally -- but @jonavellecuerdo it might be worth tagging Adam S. as a reviewer on this PR as well. He's likely in a better condition to perform any manual tests (if possible).

Adam S. doesn't do anything with this one, just SAP invoices. I still respond to all of the tickets related to this app

@jonavellecuerdo jonavellecuerdo removed the request for review from adamshire123 September 18, 2024 15:25
Copy link
Contributor

@ehanson8 ehanson8 left a comment

Choose a reason for hiding this comment

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

Great extra enhancements beyond the usual dependency and Python updates!

ccslips/cli.py Show resolved Hide resolved
ccslips/config.py Show resolved Hide resolved
* Update Python version to 3.12
* Update Python dependencies
* Update pyproject.toml and add Ruff rule G004 to 'ignore' list
* Clean up section headers in Makefile
* Update 'Environment Variables' and description in README
Why these changes are being introduced:
* Use a central Config class for dynamic access to
environment variables and simplify method for configuring
loggers.

How this addresses that need:
* Create a Config class for dynamically accessing environment variables
* Deprecate load_alma_config and update AlmaClient to use Config class to dynamically
set attributes (base_url, headers, timeout)
* Update configure_logger to use 'verbose' boolean flag
* Update CLI to accept '-v/--verbose' boolean option and remove '-l/--log-level' string option
* Add/update corresponding unit tests

Side effects of this change:
* Remove LOG_LEVEL as an optional environment variable

Relevant ticket(s):
* https://mitlibraries.atlassian.net/browse/IN-1065
@jonavellecuerdo jonavellecuerdo merged commit f99c771 into main Sep 19, 2024
3 checks passed
@jonavellecuerdo jonavellecuerdo deleted the IN-1065-maintenance-09-2024 branch September 19, 2024 18:51
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