Skip to content
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

Unable to create a sidetag update: no release associated with build #3480

Closed
ryanlerch opened this issue Aug 22, 2019 · 1 comment · Fixed by #3483
Assignees
Labels
Projects

Comments

@ryanlerch
Copy link
Contributor

@ryanlerch ryanlerch commented Aug 22, 2019

When trying to create a new update based on a sidetag, it fails, with Bodhi unable to associate a release to the sidetag.

Specifically, the error is:

Cannot find release associated with build: adwaita-blue-gtk-theme-3.22.21.0-10.fc30, tags: ['f30-build-side-7749']

This is being generated by https://github.com/fedora-infra/bodhi/blob/develop/bodhi/server/validators.py#L158

Also, note that the tests for using the from_tag field in server/services/update.py 's new_update do work, but only because it is testing using a valid candidate tag which bodhi can determine a release for.

Possibly related to: #3473

@nphilipp nphilipp added this to To do in CI Gating via automation Aug 22, 2019
@nphilipp nphilipp added the Discussion label Aug 22, 2019
@nphilipp

This comment has been minimized.

Copy link
Member

@nphilipp nphilipp commented Aug 22, 2019

The Bodhi service (backend) could determine the release from a side tag like this:

If we can't figure out the release from the tag itself, ...

  • check that the from_tag is a side tag (see the extra sub dict):
In [1]: import koji; koji_hub = 'https://koji.stg.fedoraproject.org/kojihub'; koji_client = koji.ClientSession(koji_hub, {})                                                                        

In [2]: koji_client.getTag('f31-build-side-7715')                                                                      
Out[2]: 
{'maven_support': False,
 'locked': False,
 'name': 'f31-build-side-7715',
 'extra': {'sidetag_user': 'nphilipp', 'sidetag': True, 'sidetag_user_id': 11},
 'perm': None,
 'perm_id': None,
 'arches': None,
 'maven_include_all': False,
 'id': 7715}
  • get its ancestry
In [13]: koji_client.getFullInheritance('f31-build-side-7715')                                        
Out[13]: 
[{'intransitive': False,
  'name': 'f31-build',
  'pkg_filter': '',
  'priority': 0,
  'parent_id': 6448,
  'maxdepth': None,
  'noconfig': False,
  'child_id': 7715,
  'nextdepth': None,
  'filter': [],
  'currdepth': 1},
 {'intransitive': False,
  'name': 'f31-override',
  'pkg_filter': '',
  'priority': 0,
  'parent_id': 6447,
  'maxdepth': None,
  'noconfig': False,
  'child_id': 6448,
  'nextdepth': None,
  'filter': [],
  'currdepth': 2},
 {'intransitive': False,
  'name': 'f31-updates',
  'pkg_filter': '',
  'priority': 0,
  'parent_id': 6441,
  'maxdepth': None,
  'noconfig': False,
  'child_id': 6447,
  'nextdepth': None,
  'filter': [],
  'currdepth': 3},
 {'intransitive': False,
  'name': 'f31',
  'pkg_filter': '',
  'priority': 0,
  'parent_id': 6438,
  'maxdepth': None,
  'noconfig': False,
  'child_id': 6441,
  'nextdepth': None,
  'filter': [],
  'currdepth': 4}]
  • try to match up the resulting parent tags with a release (that we store the different "roles" of tags in separate fields doesn't help here, but hey 😉)

As I mentioned, in theory the tags of one release could have tags of an older release in their ancestry but we don't seem to be doing this (anymore? ISTR seeing tag ancestries spanning releases). To be safe we could limit ourselves to dig only so deep, i.e. 3 or 4 levels which would yield the stable_tag (f31-updates) or dist_tag (f31) of the Release, respectively.

@ryanlerch ryanlerch self-assigned this Aug 22, 2019
ryanlerch added a commit to ryanlerch/bodhi that referenced this issue Aug 23, 2019
Previously, when trying to create an update from a side tag,
it would fail, as bodhi was unable to determine the release
for build(s) for that sidetag.

This commit adds code to the validate_from_tag validator to
pull the inheritance data from koji of a sidetag, and puts it
into a new per-request cache item in the request (`from_tag_inherited`)
One or more of the tags in a sidetags inhertiance structure will match
with one of the tags defined in the Bodhi Release.

Then, when validating all the builds to determine the releases, this
list is added to the regular tags to help determine the bodhi release
of the build.

Fixes: fedora-infra#3480
ryanlerch added a commit to ryanlerch/bodhi that referenced this issue Aug 23, 2019
Previously, when trying to create an update from a side tag,
it would fail, as bodhi was unable to determine the release
for build(s) for that sidetag.

This commit adds code to the validate_from_tag validator to
pull the inheritance data from koji of a sidetag, and puts it
into a new per-request cache item in the request (`from_tag_inherited`)
One or more of the tags in a sidetags inhertiance structure will match
with one of the tags defined in the Bodhi Release.

Then, when validating all the builds to determine the releases, this
list is added to the regular tags to help determine the bodhi release
of the build.

Fixes: fedora-infra#3480
Signed-off-by: Ryan Lerch <rlerch@redhat.com>
@cverna cverna moved this from To do to Ready in CI Gating Aug 26, 2019
@ryanlerch ryanlerch moved this from Ready to Need Review in CI Gating Aug 27, 2019
ryanlerch added a commit to ryanlerch/bodhi that referenced this issue Aug 28, 2019
Previously, when trying to create an update from a side tag,
it would fail, as bodhi was unable to determine the release
for build(s) for that sidetag.

This commit adds code to the validate_from_tag validator to
pull the inheritance data from koji of a sidetag, and puts it
into a new per-request cache item in the request (`from_tag_inherited`)
One or more of the tags in a sidetags inhertiance structure will match
with one of the tags defined in the Bodhi Release.

Then, when validating all the builds to determine the releases, this
list is added to the regular tags to help determine the bodhi release
of the build.

Fixes: fedora-infra#3480
Signed-off-by: Ryan Lerch <rlerch@redhat.com>
@mergify mergify bot closed this in #3483 Sep 2, 2019
CI Gating automation moved this from Need Review to Merged to develop Sep 2, 2019
mergify bot added a commit that referenced this issue Sep 2, 2019
Previously, when trying to create an update from a side tag,
it would fail, as bodhi was unable to determine the release
for build(s) for that sidetag.

This commit adds code to the validate_from_tag validator to
pull the inheritance data from koji of a sidetag, and puts it
into a new per-request cache item in the request (`from_tag_inherited`)
One or more of the tags in a sidetags inhertiance structure will match
with one of the tags defined in the Bodhi Release.

Then, when validating all the builds to determine the releases, this
list is added to the regular tags to help determine the bodhi release
of the build.

Fixes: #3480
Signed-off-by: Ryan Lerch <rlerch@redhat.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
CI Gating
  
Merged to develop
2 participants
You can’t perform that action at this time.