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

Refine default behaviour of config engine to support easier migration from 1.8 #1573

Merged
merged 2 commits into from Apr 9, 2024

Conversation

SpacemanPaul
Copy link
Contributor

Reason for this pull request

Previously when:

  1. no config file exists in the search path (or the config file does not defined a default or datacube environment); and
  2. config is being passed in with the legacy $DB_* environment variables; and
  3. no environment is explicitly nominated:

a ConfigException was raised.

This is a very common scenario in existing 1.8.x ODC applications, and throwing an error is unexpected behaviour that makes migration from 1.8 to 1.9 more complex than it needs to be.

Proposed changes

When:

  1. no config file exists in the search path (or the config file does not define a default or datacube environment); and
  2. no environment is explicitly nominated:

The environment now defaults to default on the assumption that configuration will be available in the next step via environment variables.

  • Tests added / passed
  • Fully documented, including docs/about/whats_new.rst for all changes

Copy link

codecov bot commented Apr 9, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 85.58%. Comparing base (9561764) to head (bedf264).

Additional details and impacted files
@@             Coverage Diff              @@
##           develop-1.9    #1573   +/-   ##
============================================
  Coverage        85.58%   85.58%           
============================================
  Files              140      140           
  Lines            15384    15384           
============================================
  Hits             13167    13167           
  Misses            2217     2217           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@omad omad left a comment

Choose a reason for hiding this comment

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

Sounds good to me.

@omad omad merged commit a8ec892 into develop-1.9 Apr 9, 2024
30 checks passed
@omad omad deleted the default-config-behaviour branch April 9, 2024 02:38
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.

None yet

2 participants