-
Notifications
You must be signed in to change notification settings - Fork 463
WIP: Create PackageUpstreamVersionSourceChanged event
#18642
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?
WIP: Create PackageUpstreamVersionSourceChanged event
#18642
Conversation
krauselukas
left a comment
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.
Going to rework the Event name, "PackageOutOfDate" sounds a little to alerting...
What about "UpdateAvailable"? |
362aabc to
362b1db
Compare
PackageOutOfDate eventNewUpstreamPackageSourceAvailable event
I renamed it to "NewUpstreamPackageSourceAvailable", what do you think? |
src/api/app/models/event/new_upstream_package_source_available.rb
Outdated
Show resolved
Hide resolved
8ce56fc to
495c1a4
Compare
| Event::NewUpstreamPackageSourceAvailable.create(local_version: local_version_string, upstream_version: version, | ||
| package: package.name, project: package.project.name) | ||
| end | ||
| rescue ArgumentError |
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.
Why this?
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.
@danidoni this is gone now, please see my comments below for explanation :)
NewUpstreamPackageSourceAvailable eventNewUpstreamPackageSourceAvailable event
| context 'when the local package version is older then the upstream one' do | ||
| let!(:package_version_local) { create(:package_version_local, version: '2.0.0', package: package) } | ||
|
|
||
| it 'creates a PackageOutOfDate event' do |
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.
| it 'creates a PackageOutOfDate event' do | |
| it 'creates a NewUpstreamPackageSourceAvailable event' do |
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.
since the context of this PR changed the spec has changed entirely, please have another look :)
| context 'when the local package version is equal to the upstream one' do | ||
| let!(:package_version_local) { create(:package_version_local, version: '2.1.0', package: package) } | ||
|
|
||
| it 'does not create a PackageOutOfDate event' do |
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.
| it 'does not create a PackageOutOfDate event' do | |
| it 'does not create a NewUpstreamPackageSourceAvailable event' do |
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.
same here
|
Can we remove the "WIP: " from the PR title? |
|
[BACK TO WIP]: Talked to @hellcp-work right now we cannot really rely on the version string coming from release monitoring for comparison, since in quite a few cases they don't follow a scheme that is compatible with the one we use locally for our packages. Therefore we better just always notify people if something changed upstream and then let people check manually if any action in terms of updating a package makes sense or not. Therefore I need to remove the version comparision part from this PR and change naming etc. |
Send out an event when the upstream version of a package has changed
495c1a4 to
17dc6ea
Compare
NewUpstreamPackageSourceAvailable eventPackageUpstreamVersionSourceChanged event
|
@danidoni @saraycp @hellcp-work so I adapted the PR to always create an event when a PackageVersionUpstream record is created. No version comparison or similar anymore. As an explanation why we decided to do so, for example some perl packages use upstream the version string "1.020" where on our side the rpm uses "1.20" for the same version. Comparing them would lead to faulty results. That's why we decided to skip the version comparison for now and simply always notify users when there is a version change upstream and let them decide themself if it is an actual update or not. |
PackageUpstreamVersionSourceChanged eventPackageUpstreamVersionSourceChanged event
|
Back to WIP again, need to add couple more things, realized that while working on the notifications for this event... |
Send out an event when the upstream version of a package has changed
https://trello.com/c/iVcdSoAx/2867-create-an-event-when-a-new-release-is-available-m