Skip to content

SSW-3012: Use ACCESS_TOKEN in ConsDbClient by default. - #199

Merged
bbrondel merged 2 commits into
mainfrom
tickets/SSW-3012
Oct 26, 2026
Merged

bbrondel merged 2 commits into
mainfrom
tickets/SSW-3012

Conversation

@bbrondel

@bbrondel bbrondel commented Oct 5, 2026

Copy link
Copy Markdown
Collaborator

If a valid token is contained in the ACCESS_TOKEN environment variable, it will be sent by default by the ConsDbClient.

@sebastian-aranda sebastian-aranda left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Looks good to me 👍 .

@github-actions

Copy link
Copy Markdown

mypy-coverage report

✅ All 845 definitions are fully annotated.

  • Root: /home/runner/work/summit_utils/summit_utils
  • Config: mypy.ini
  • Files scanned: 62
  • Files excluded: 0

Summary

metric value
✅ body-checked by mypy 100.0%
✅ fully annotated 100.0%
annotated 845
partial 0
unannotated 0

@codecov

codecov Bot commented Oct 19, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 24.60%. Comparing base (b429732) to head (0153a83).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #199      +/-   ##
==========================================
+ Coverage   24.37%   24.60%   +0.22%     
==========================================
  Files          39       39              
  Lines        7228     7238      +10     
==========================================
+ Hits         1762     1781      +19     
+ Misses       5466     5457       -9     
Files with missing lines Coverage Δ
python/lsst/summit/utils/consdbClient.py 79.02% <100.00%> (+5.69%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@mfisherlevine mfisherlevine left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I wrote these comments ages ago, but it seems I forget to submit them, sorry about that!

self.read_timeout = read_timeout

if token is None:
token = os.environ.get("ACCESS_TOKEN") or None

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I think that's more usually expressed as .get("ACCESS_TOKEN", None) but this is fine too.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I think this is to prevent empty strings in ACCESS_TOKEN, i.e. if .get("ACCESS_TOKEN", None) when ACCESS_TOKEN="" then the sentence returns an empty string instead of None.

if token is None:
token = os.environ.get("ACCESS_TOKEN") or None
if token is not None:
if token.startswith("gt-"):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Assuming this is always going to be correct this is fine. I wonder what would cause this to be wrong, or why this is always the case. You can probably just ignore my ponderings though.

@bbrondel
bbrondel merged commit 083e6dc into main Oct 26, 2026
14 checks passed
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.

3 participants