-
-
Notifications
You must be signed in to change notification settings - Fork 957
Build trusted publisher filter #5237
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
base: master
Are you sure you want to change the base?
Build trusted publisher filter #5237
Conversation
e4377b6
to
831a27f
Compare
@@ -411,6 +411,10 @@ def gem_file_name | |||
"#{full_name}.gem" | |||
end | |||
|
|||
def pushed_by_trusted_publisher? | |||
pusher_api_key&.trusted_publisher? ? true : false |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Doesn't trusted_publisher?
already return true/false? Is there any reason for explicit ? true: false
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The safe navigator means a nil value can be returned if the version has no pusher_api_key
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would pusher_api_key? && pusher_api_key.trusted_publisher?
work also?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, but pusher_api_key.present? && pusher_api_key.trusted_publisher?
would work. It is a matter of preference here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Or maybe pusher_api_key&.trusted_publisher? || false
. Yes, just a nitpick indeed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Am I the only one that prefers !!
to force boolean?
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## master #5237 +/- ##
==========================================
- Coverage 97.11% 94.33% -2.79%
==========================================
Files 454 454
Lines 9441 9502 +61
==========================================
- Hits 9169 8964 -205
- Misses 272 538 +266 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Linked issue: #4807 |
CI seems unhappy about this test. rubygems.org/test/models/pusher_test.rb Lines 632 to 659 in 1143eba
|
@@ -25,7 +25,8 @@ module RubygemSearchable | |||
suggest: { type: "completion", contexts: { name: "yanked", type: "category" } }, | |||
yanked: { type: "boolean" }, | |||
downloads: { type: "long" }, | |||
updated: { type: "date" } | |||
updated: { type: "date" }, | |||
trusted_publisher: { type: "boolean" } |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does this mapping change need full re-indexing?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Good question. I would not think so, since there is no change to the database source schema, but I am not sure. It is my first time committing to this repo and I do not have full context, so I will wait for others to weigh in.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any new mappings do require a reindex, which is easy to do but needs some coordination when deployed.
831a27f
to
1e21932
Compare
@justinddaniel Thank you for contributing this! Pleasure working with you today. |
8827009
to
ecb6a85
Compare
The coverage fail can be ignored. What's the harm in merging this without reindexing? Will it just ignore the option until we do? If that's all, can we merge and then run the reindexing at our convenience? |
ecb6a85
to
8bf1b85
Compare
No description provided.