-
Notifications
You must be signed in to change notification settings - Fork 433
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
Create job to report build status to SCM via SCMStatusReporter #11124
Conversation
e2f4532
to
ed3125b
Compare
9f85d8b
to
82de217
Compare
82de217
to
0ff419e
Compare
0ff419e
to
06714ca
Compare
b92aef4
to
627472a
Compare
ff2013c
to
349f692
Compare
After changing the from the attempt of building an association between an event and a package, to fetching the package using the passed payload in the `ReportToScmJob` in openSUSE#11124 the package_id is not longer needed.
After changing the from the attempt of building an association between an event and a package, to fetching the package using the passed payload in the `ReportToScmJob` in openSUSE#11124 the package_id is not longer needed.
After changing the from the attempt of building an association between an event and a package, to fetching the package using the passed payload in the `ReportToScmJob` in openSUSE#11124 the package_id is not longer needed.
349f692
to
87a9381
Compare
87a9381
to
e0d708e
Compare
let(:project) { create(:project, name: 'project_1', maintainer: user) } | ||
let(:package) { create(:package, name: 'package_1', project: project) } | ||
let(:repository) { create(:repository, name: 'repository_1', project: project) } | ||
let(:event) { Event::BuildSuccess.create({ project: project.name, package: package.name, repository: repository.name, reason: 'foo' }) } |
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.
This event creation triggers a ReportToScmJob
run because this after_create and our current active job configuration. So this spec triggers the job twice.
end | ||
|
||
it 'does not call the scm reporter' do | ||
expect_any_instance_of(SCMStatusReporter).not_to receive(:call) # rubocop:disable RSpec/AnyInstance |
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.
This expectation can be refactored later in another PR using a custom status reporter passed as parameter to the ReportToScmJob
.
e0d708e
to
7e49e06
Compare
@danidoni I would clean up a bit the commit history, the third commit in this PR (Extend Event classes to track a package) does not really do what it describes anymore. Besided that it looks good to me |
@@ -0,0 +1,29 @@ | |||
require 'rails_helper' | |||
|
|||
RSpec.describe ReportToScmJob, vcr: false 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.
Is vcr
set to false
on purpose? Could it just be removed?
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.
Enabling this just records calls to backend that are not related to the spec. So I think we don't need to enable 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.
so no need to add the flag, right?
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.
I'm working on an improved spec, I will take care of that there
I will squash them all into just one commit. |
7e49e06
to
5926f24
Compare
Extracted from #11060
If this PR requires any particular action or consideration before deployment,
please check the reasons or add your own to the list:
[1] https://github.com/openSUSE/open-build-service/wiki/Deployment-of-build.opensuse.org#when-there-are-migrations
[2] https://github.com/openSUSE/open-build-service/wiki/Feature-Toggles-%28Flipper%29#you-want-real-people-to-test-your-feature