Skip to content

Conversation

@lioman
Copy link
Contributor

@lioman lioman commented Apr 4, 2025

id implements detection of different providers, like Github, Gitlab etc. With that pdm does not need to take care of all supported providers and can stand of the shoulder of that library that twine uses as well.

  • removed pdm's implementation of generating a token
  • add id dependency and use it
  • add test dependency to mock httpx requests
  • add test for oidc auth of Repository

Pull Request Checklist

  • A news fragment is added in news/ describing what is new.
  • Test cases added for changed code.

Closes: #3441

@frostming
Copy link
Collaborator

That's cool. Thanks

@codecov
Copy link

codecov bot commented Apr 4, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 85.60%. Comparing base (2d3db0f) to head (d4081bc).
Report is 80 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #3442      +/-   ##
==========================================
+ Coverage   85.35%   85.60%   +0.24%     
==========================================
  Files         112      112              
  Lines       11549    11550       +1     
  Branches     2534     2535       +1     
==========================================
+ Hits         9858     9887      +29     
+ Misses       1162     1133      -29     
- Partials      529      530       +1     
Flag Coverage Δ
unittests 85.40% <100.00%> (+0.24%) ⬆️

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

☔ View full report in Codecov by Sentry.
📢 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.

@lioman
Copy link
Contributor Author

lioman commented Apr 4, 2025

@frostming please wait a bit. I will increase test coverage and want to test it with gitlab, so that I can add some example to the documentation.

@lioman lioman force-pushed the use-id-to-support-different-oicd-platforms branch 2 times, most recently from fc1a995 to 0cd91d7 Compare April 4, 2025 12:53
@lioman lioman marked this pull request as draft April 4, 2025 12:54
@lioman lioman force-pushed the use-id-to-support-different-oicd-platforms branch from 182aec2 to 37f5aa5 Compare April 4, 2025 14:01
@lioman lioman marked this pull request as ready for review April 4, 2025 14:01
@lioman lioman force-pushed the use-id-to-support-different-oicd-platforms branch from 37f5aa5 to aa5bef3 Compare April 4, 2025 14:15
@lioman lioman requested a review from frostming April 4, 2025 14:17
@lioman
Copy link
Contributor Author

lioman commented Apr 4, 2025

I tested it with gitlab: https://gitlab.com/lioman/nextcloud_news_filter/-/jobs/9627357043 and it works.

@lioman lioman force-pushed the use-id-to-support-different-oicd-platforms branch from aa5bef3 to d2a7e52 Compare April 5, 2025 06:17
@lioman lioman requested a review from frostming April 5, 2025 06:18
with pytest.raises(PdmUsageError):
Repository(project, config=config)
captured = capsys.readouterr()
assert "Unable to detect OICD token for CI platform:" in captured.err
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
assert "Unable to detect OICD token for CI platform:" in captured.err
assert "Unable to detect OIDC token for CI platform:" in captured.err

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Sorry - I screwed up. Fixed it now.

`id` implements detection of different providers, like Github, Gitlab etc.
With that pdm does not need to take care of all supported providers
and can stand of the shoulder of that library that `twine` uses as well.

- removed pdm's implementation of generating a token
- add id dependency and use it
- add test dependency to mock httpx requests
- add test for oidc auth of Repository
@lioman lioman force-pushed the use-id-to-support-different-oicd-platforms branch from d2a7e52 to d4081bc Compare April 5, 2025 17:36
@lioman lioman requested a review from frostming April 5, 2025 17:36
@frostming frostming merged commit 0fabc96 into pdm-project:main Apr 7, 2025
21 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.

Support more trusted publishing providers

2 participants