Skip to content

Conversation

@krauselukas
Copy link
Contributor

@krauselukas krauselukas commented Oct 10, 2025

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

@krauselukas krauselukas added the Frontend Things related to the OBS RoR app label Oct 10, 2025
Copy link
Contributor Author

@krauselukas krauselukas left a 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...

@danidoni
Copy link
Contributor

Going to rework the Event name, "PackageOutOfDate" sounds a little to alerting...

What about "UpdateAvailable"?

@krauselukas krauselukas force-pushed the create_package_out_of_date_event01 branch from 362aabc to 362b1db Compare October 14, 2025 14:32
@krauselukas krauselukas changed the title Create PackageOutOfDate event Create NewUpstreamPackageSourceAvailable event Oct 14, 2025
@krauselukas
Copy link
Contributor Author

krauselukas commented Oct 14, 2025

Going to rework the Event name, "PackageOutOfDate" sounds a little to alerting...

What about "UpdateAvailable"?

I renamed it to "NewUpstreamPackageSourceAvailable", what do you think?

@krauselukas krauselukas force-pushed the create_package_out_of_date_event01 branch 3 times, most recently from 8ce56fc to 495c1a4 Compare October 15, 2025 12:04
Event::NewUpstreamPackageSourceAvailable.create(local_version: local_version_string, upstream_version: version,
package: package.name, project: package.project.name)
end
rescue ArgumentError
Copy link
Contributor

Choose a reason for hiding this comment

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

Why this?

Copy link
Contributor Author

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 :)

@krauselukas krauselukas changed the title Create NewUpstreamPackageSourceAvailable event WIP: Create NewUpstreamPackageSourceAvailable event Oct 16, 2025
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
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
it 'creates a PackageOutOfDate event' do
it 'creates a NewUpstreamPackageSourceAvailable event' do

Copy link
Contributor Author

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
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
it 'does not create a PackageOutOfDate event' do
it 'does not create a NewUpstreamPackageSourceAvailable event' do

Copy link
Contributor Author

Choose a reason for hiding this comment

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

same here

@saraycp
Copy link
Contributor

saraycp commented Oct 16, 2025

Can we remove the "WIP: " from the PR title?

@krauselukas
Copy link
Contributor Author

krauselukas commented Oct 16, 2025

[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.

@krauselukas krauselukas force-pushed the create_package_out_of_date_event01 branch from 495c1a4 to 17dc6ea Compare October 16, 2025 14:04
@krauselukas krauselukas changed the title WIP: Create NewUpstreamPackageSourceAvailable event Create PackageUpstreamVersionSourceChanged event Oct 16, 2025
@krauselukas
Copy link
Contributor Author

krauselukas commented Oct 16, 2025

@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.

@krauselukas krauselukas changed the title Create PackageUpstreamVersionSourceChanged event WIP: Create PackageUpstreamVersionSourceChanged event Oct 17, 2025
@krauselukas
Copy link
Contributor Author

Back to WIP again, need to add couple more things, realized that while working on the notifications for this event...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Frontend Things related to the OBS RoR app

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants