-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Implement Logging for Bundler v1 Deprecation Warnings #10466
Conversation
78e5dbc
to
8732d33
Compare
b719aa8
to
9c96ce1
Compare
6d56799
to
e19f2c9
Compare
The following up PR needs this PR to be done. |
Taggin @Nishnha and @honeyankit for reviews |
Thanks. |
e19f2c9
to
5ade344
Compare
@honeyankit |
5ade344
to
8de1aa7
Compare
Hi it looks like this PR renames a few fields, like I was wondering how these new fields are used? Was the I also noticed that this introduces a lot of code to say exactly what versions of the package manager users can upgrade to. But it might just be easier to say "Please upgrade your package manager version" without specifying the versions themselves. Finally, would it make more sense to display the deprecation notice at the start of the job log instead of after gathering the requirements to unlock? |
Hi @Nishnha , This PR is continuation of the previous completed task, https://github.com/dependabot/dependabot-core/pull/10421/files. We just started to have notice structure for showing Notice. So before it is defined as message however that's was confussing since we are going to show this information in alert body description. So That's why it is renamed after discussing with @abdulapopoola. Title is also going to be show on top of the warning alert as a description on insight page. Normally we are generating title on dependabot-api for errors but this causing to always make changes on dependabot-api to add new errrors. So I made decision to add title to notices that can be completely managable from dependabot-core instead of dependabot-api.
For that I discussed that with @jonjanego. If package manager class doesn't have the supported list basicly we are not showing this message and just sharing the warning. If the list is defined then we are showing this message.
The reason of not showing at the start was because I am showning all warnings (notices) when we are ready to create PR. For deprecation it may be possible to show at start. However I thought it is ok not showing warning when there is error or PR is up-to-date. |
8de1aa7
to
c68511d
Compare
Oh okay I didn't realize it would also show in alert descriptions. That makes sense!
Got it - that seems like a roundabout way of doing it though. I think it would be easier to check if the package manager version needs the deprecation warning in Dependabot API, and if it does, pass that warning message along with the job details. Feel free to push back on this though. I know you already have a lot of the plumbing set up in Core.
I think it would be okay to always show the warning for a package manager that is about to be deprecated. I also think it's more likely to be seen at the top of a job log. |
Chatted with @kbukum1 on this and we actually do not have all the package manager version information until the job runs. So this has to be done in core after the file parser runs. |
The problems we discussed are solved. Here is the last screenshot. Problems:
|
logged deprecation warning.
- remove the markdown field, and created generation markdown method.
3ea6441
to
b0ab24a
Compare
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.
Nice this is a lot easier to read! I see a failing CI test but I think it's unrelated to this PR?
I'm happy to approve this PR as-is, but I do notice a few things that we could improve before merging.
In the generate_supported_versions_description
method, why is the support_later_versions?
parameter used? I'm not familiar with the method so I was wondering when does Dependabot say it supports later versions instead of explicitly stating which versions it supports?
Another thing is, can we add the deprecation notice to the logs in 1 spot instead of adding it to all 4 operations? If we can, I think it would be easier to maintain!
@Nishnha , Thanks for the review.
I think that is going to be hard because we don't know package manager until we are in the operation loop. Only one place is possible which is creation of dependency_snapshot but I am thinking that is not right place to do operation related to notice. |
@kbukum1 and I had a sync to discuss this and it does seem like it would be difficult to add the notices/warnings anywhere else. It also makes sense to keep the notices in the operations because as the job is processed, we may discover more things that we want to add a notice for, and the notice may differ for each operation. So duplicating the notices in each of the operations is intentional 👍🏾 |
As @Nishnha mentioned we added notices list for each operations so that it can be used to create new notices in any stage of the operation. Also we added generation of deprecation notice in the dependency_snapshot because that is the unique before starting operation to get package manager information. Also since when we are using dependency snapshot we need workspace to be set (@current_directory), we decided to log deprecation notice here after parsing the dependency files. |
What are you trying to accomplish?
This PR introduces a deprecation warning logging for
bundler v1
.Why:
This change ensures users are informed when using deprecated versions of Bundler and provides a structured approach for handling similar deprecations in other ecosystems.
Anything you want to highlight for special attention from reviewers?
The changes are focused on showing notices in the log. Especially this implementation adds structure to log notices and show
bundler v1 deprecation warning
in the log.How will you know you've accomplished your goal?
Example warning
Example log when updating job on bundler v1.
The following
Checklist