Skip to content

Improve resource grains, add persistent cache - #38

Merged
lkubb merged 4 commits into
mainfrom
tests-updates
Oct 16, 2026
Merged

lkubb merged 4 commits into
mainfrom
tests-updates

Conversation

@lkubb

@lkubb lkubb commented Oct 16, 2026 •

Copy link
Copy Markdown
Member

What does this PR do?

  • Ensures grains can actually be inspected, not just used for targeting
  • Adds grains_files to load data from a repository and expose it as grains (motivated by loading .copier-answers.yml values, should be useful more widely though)
  • Adds a very specific persistent cache for auth token user, account type lookup and the above files (auto-refreshed when the repo has been pushed to since the last refresh)
  • Adds more information to the repo info output - nothing that's not found in the initial list of repositories though to avoid causing a separate request

Merge requirements satisfied?

Commits signed with GPG?

Yes

@codecov

codecov Bot commented Oct 16, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 85.62963% with 97 lines in your changes missing coverage. Please review.
✅ Project coverage is 95.80%. Comparing base (5375ae4) to head (5143636).

Files with missing lines Patch % Lines
src/saltext/github/utils/gh/repos.py 35.93% 41 Missing ⚠️
src/saltext/github/resources/github/__init__.py 5.26% 18 Missing ⚠️
src/saltext/github/utils/gh/client.py 62.50% 6 Missing and 9 partials ⚠️
src/saltext/github/utils/gh/grains_files.py 94.61% 7 Missing and 2 partials ⚠️
tests/support/github/entities.py 76.31% 9 Missing ⚠️
src/saltext/github/utils/gh/profile.py 88.23% 1 Missing and 1 partial ⚠️
tests/support/github/routes/contents.py 71.42% 2 Missing ⚠️
src/saltext/github/utils/gh/cache.py 97.95% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #38      +/-   ##
==========================================
- Coverage   96.69%   95.80%   -0.90%     
==========================================
  Files         132      137       +5     
  Lines        7657     8311     +654     
  Branches      535      616      +81     
==========================================
+ Hits         7404     7962     +558     
- Misses        213      296      +83     
- Partials       40       53      +13     
Flag Coverage Δ
Linux 95.80% <85.62%> (-0.90%) ⬇️
macOS 95.80% <85.62%> (-0.90%) ⬇️
project 93.01% <75.84%> (-2.22%) ⬇️
py310 86.95% <85.62%> (-0.14%) ⬇️
py311 86.95% <85.62%> (-0.14%) ⬇️
py314 95.75% <85.54%> (-0.91%) ⬇️
salt_3006_27 86.95% <85.62%> (-0.14%) ⬇️
salt_3008_2 95.75% <85.54%> (-0.91%) ⬇️
tests 97.46% <96.55%> (-0.07%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@lkubb
lkubb merged commit cfcdbdd into main Oct 16, 2026
16 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.

1 participant