Skip to content

DM-55061: Calculate default value of dbauth_alias#144

Merged
andy-slac merged 1 commit into
mainfrom
tickets/DM-55061
May 27, 2026
Merged

DM-55061: Calculate default value of dbauth_alias#144
andy-slac merged 1 commit into
mainfrom
tickets/DM-55061

Conversation

@andy-slac

Copy link
Copy Markdown
Collaborator

No description provided.

@codecov

codecov Bot commented May 27, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 84.90%. Comparing base (8573ff4) to head (91b6224).
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #144      +/-   ##
==========================================
+ Coverage   84.83%   84.90%   +0.07%     
==========================================
  Files          73       73              
  Lines        7385     7408      +23     
  Branches      847      850       +3     
==========================================
+ Hits         6265     6290      +25     
+ Misses        883      881       -2     
  Partials      237      237              

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

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Adds support for deriving a default dbauth_alias for Cassandra db-auth credential lookup when the alias is not explicitly configured, enabling automatic selection of prod/dev credential entries based on username and keyspace.

Changes:

  • Added ApdbCassandraConfig.get_dbauth_alias() to compute a default alias when connection_config.dbauth_alias is empty.
  • Updated SessionFactory._make_auth_provider() to use the computed alias (when available) with higher priority than contact points.
  • Extended Cassandra db-auth tests to cover the new derived-alias behavior.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 3 comments.

File Description
tests/test_apdbCassandra.py Adds db-auth fixtures and assertions to validate derived alias lookup behavior.
python/lsst/dax/apdb/cassandra/sessionFactory.py Switches db-auth host selection to use computed alias via config helper.
python/lsst/dax/apdb/cassandra/config.py Introduces get_dbauth_alias() and updates dbauth_alias field description to document defaulting behavior.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread python/lsst/dax/apdb/cassandra/sessionFactory.py Outdated
Comment thread python/lsst/dax/apdb/cassandra/config.py Outdated
Comment thread tests/test_apdbCassandra.py Outdated
@andy-slac andy-slac merged commit b4d6f81 into main May 27, 2026
21 checks passed
@andy-slac andy-slac deleted the tickets/DM-55061 branch May 27, 2026 13:52
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.

2 participants