Skip to content

Too many copr builds triggered when tests jobs are defined #2669

@majamassarini

Description

@majamassarini

Working on re-triggering of failed tests, I realized we are triggering non needed copr builds.

jobs:
- job: copr_build
  trigger: pull_request
  identifier: latest
  targets:
  - fedora-latest-x86_64

- job: copr_build
  trigger: pull_request
  targets:
  - fedora-rawhide-x86_64

The above snippet is taken from this PR; one copr build for rawhide and one for f41 with latest identifier should be enough, instead we are triggering even the rawhide build in the copr repo with latest identifier and the f41 build in the copr repo with no identifier.
This is caused by the definition of tests jobs (not listed in the snippet) for which we are looking in all defined targets:

for test_job in self.job_tests_all:
if not test_job.skip_build:
targets.update(test_job.targets)

There are no issues for any user but we are wasting resources.


There is also another issue related with the wrong build_targets count.

if isinstance(job_helper, CoprBuildJobHelper):
number_of_build_targets = len(job_helper.build_targets)

We are submitting the wrong number of build_targets (for too many times) to the pushgateway.
When there are multiple copr jobs defined and there is also at least one test job defined, we are submitting for every copr job and every test job the sum of all defined targets (since the CoprBuildJobHelper is initialized even for the tests jobs).
I think this is the cause of our wrong metrics #2430 (we have many more queued tasks than started or finished).

Metadata

Metadata

Assignees

Labels

area/coprRelated to the Copr integrationcomplexity/single-taskRegular task; should be done within daysgain/highBrings a lot of value to usersimpact/highAffects a lot of userskind/bugAn unexpected problem or behavior

Type

No type

Projects

Status

done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions