#104 brew/koji-build-group: add required sidetag name
Merged 3 years ago by mvadkert. Opened 3 years ago by mvadkert.
fedora-ci/ mvadkert/messages rfe-sidetag-name  into  master

@@ -10,6 +10,7 @@ 

      "artifact": {

          "type": "brew-build-group",

          "id": "sha256:0f41e56a1c32519e189ddbcb01d2551e861bd74e603d01769ef5f70d4b30a2dd",

+         "sidetag_name": "rhel-8.2.0-selinux-stack-gate",

          "repository": "https://some.url/repo",

          "builds":

              [{

@@ -10,6 +10,7 @@ 

      "artifact": {

          "type": "brew-build-group",

          "id": "sha256:0f41e56a1c32519e189ddbcb01d2551e861bd74e603d01769ef5f70d4b30a2dd",

+         "sidetag_name": "rhel-8.2.0-selinux-stack-gate",

          "repository": "https://some.url/repo",

          "builds":

              [{

@@ -18,6 +18,7 @@ 

      "artifact": {

          "type": "brew-build-group",

          "id": "sha256:0f41e56a1c32519e189ddbcb01d2551e861bd74e603d01769ef5f70d4b30a2dd",

+         "sidetag_name": "rhel-8.2.0-selinux-stack-gate",

          "repository": "https://some.url/repo",

          "builds":

              [{

@@ -18,6 +18,7 @@ 

      "artifact": {

          "type": "brew-build-group",

          "id": "sha256:0f41e56a1c32519e189ddbcb01d2551e861bd74e603d01769ef5f70d4b30a2dd",

+         "sidetag_name": "rhel-8.2.0-selinux-stack-gate",

          "repository": "https://some.url/repo",

          "builds":

              [{

@@ -18,6 +18,7 @@ 

      "artifact": {

          "type": "brew-build-group",

          "id": "sha256:0f41e56a1c32519e189ddbcb01d2551e861bd74e603d01769ef5f70d4b30a2dd",

+         "sidetag_name": "rhel-8.2.0-selinux-stack-gate",

          "repository": "https://some.url/repo",

          "builds":

              [{

@@ -18,6 +18,7 @@ 

      "artifact": {

          "type": "brew-build-group",

          "id": "sha256:0f41e56a1c32519e189ddbcb01d2551e861bd74e603d01769ef5f70d4b30a2dd",

+         "sidetag_name": "rhel-8.2.0-selinux-stack-gate",

          "repository": "https://some.url/repo",

          "builds":

              [{

@@ -10,6 +10,7 @@ 

      "artifact": {

          "type": "koji-build-group",

          "id": "sha256:0f41e56a1c32519e189ddbcb01d2551e861bd74e603d01769ef5f70d4b30a2dd",

+         "sidetag_name": "f29-build-side-12345",

          "repository": "https://some.url/repo",

          "builds":

              [{

@@ -10,6 +10,7 @@ 

      "artifact": {

          "type": "koji-build-group",

          "id": "sha256:0f41e56a1c32519e189ddbcb01d2551e861bd74e603d01769ef5f70d4b30a2dd",

+         "sidetag_name": "f29-build-side-12345",

          "repository": "https://some.url/repo",

          "builds":

              [{

@@ -18,6 +18,7 @@ 

      "artifact": {

          "type": "koji-build-group",

          "id": "sha256:0f41e56a1c32519e189ddbcb01d2551e861bd74e603d01769ef5f70d4b30a2dd",

+         "sidetag_name": "f29-build-side-12345",

          "repository": "https://some.url/repo",

          "builds":

              [{

@@ -18,6 +18,7 @@ 

      "artifact": {

          "type": "koji-build-group",

          "id": "sha256:0f41e56a1c32519e189ddbcb01d2551e861bd74e603d01769ef5f70d4b30a2dd",

+         "sidetag_name": "f29-build-side-12345",

          "repository": "https://some.url/repo",

          "builds":

              [{

@@ -19,6 +19,7 @@ 

          "type": "koji-build-group",

          "id": "sha256:0f41e56a1c32519e189ddbcb01d2551e861bd74e603d01769ef5f70d4b30a2dd",

          "repository": "https://some.url/repo",

+         "sidetag_name": "f29-build-side-12345",

          "builds":

              [{

                  "type": "koji-build",

@@ -19,6 +19,7 @@ 

          "type": "koji-build-group",

          "id": "sha256:0f41e56a1c32519e189ddbcb01d2551e861bd74e603d01769ef5f70d4b30a2dd",

          "repository": "https://some.url/repo",

+         "sidetag_name": "f29-build-side-12345",

          "builds":

              [{

                  "type": "koji-build",

@@ -28,6 +28,14 @@ 

              - sha256:fc5883ecb0bd9086b73aa27878682e44bf14f561eefc28b2727089ea4d3223a7

          type: string

          pattern: "sha256:[A-Fa-f0-9]{64}"

+     sidetag_name:

+         description:

+             A human readable name of the sidetag as Koji or Brew knows it. Note that

+             the sidetag name does not need to be unique in certain cases.

+         type: string

+         examples:

+             - rhel-8.3.0-dnf-stack-gate

+             - f32-build-side-23196

      type:

          description:

              Artifact type.
@@ -51,6 +59,7 @@ 

  

  required:

      - id

+     - sidetag_name

      - type

      - builds

      - repository

After discussion with Greenwave folks, we have identified
that it is needed to have this value around to be able
to map a brew/koji-build-group back to Koji or Brew,
with an additional check on has counted from the brew builds.

Seems feasible, without this information this is basically
impossible to do ...

Signed-off-by: Miroslav Vadkerti mvadkert@redhat.com

@msrb @lholecek @bookwar @vmaljulin as discussed, submitting the change to spec ...

Metadata Update from @mvadkert:
- Pull-request tagged with: review-needed

3 years ago

@mvadkert I know we discussed this, but I don't remember what problem this change addresses exactly. Could you please refresh my memory?

@mvadkert I know we discussed this, but I don't remember what problem this change addresses exactly. Could you please refresh my memory?

Ah, I forgot about this. Not sure if this was just a suggestion in the end, but it was mentioned in the "Discussion about sidetag support in Greenwave" doc:

Suggestion
- Look for the gating rule under the hash
- If there is no rule under hash - look for rule under sidetag name
- Q: does greenwave know the sidetag name?
- AI mvadkert Add sidetag name to the ci message next to artifact id
as a separate field

- Done: https://pagure.io/fedora-ci/messages/pull-request/104
- AI greenwave - support looking up gating yaml also from the sidetag name (next to the hash)

I think it's not needed, if we will be able to query the new external API (with side-tag ID) to provide policies (YAML).

@lholecek ah, right. Thanks for the clarification Lukas.

@mvadkert I tend to agree with @lholecek that this is probably no longer needed? Also, if the goal is to move to dynamic side-tags in future, there won't be any static side-tags, so people won't be able to create the policy in advance anyway... or am I am missing something?

@lholecek @msrb trying to explain more ....

a) Still, I would like to keep the sidetag name here, it is an additional information as it good to keep it there for general references (it is a ID which Brew/Koji knows)

b) The problem we need to solve in Gating bot in regards to this is:

  1. Gating bot reacts on sidetag decision update events
  2. If the sidetag is good to go, it has to tag all the builds to a given "final destination" tag (e.g. rhel-8.2.0-candidate)

So the question is, how does gating bot get from a sidetag decision update to the list of builds, which he has to supply to brew move-build command?

This could help in that situation, as the gating bot could use the sidetag name to lookup the builds in it and compare it with the hash. If the hash matches, it can move the packages. If the hash does not match, it will not take any action as the sidetag content is different (i.e. sidetag changed, no action should be taken)

@lholecek @msrb still against the change? does above help or not too much?

+1 I'm not against - having a nice readable name is often important.

Would need at least +1 :) @ralph @odockal @msrb what do you say guys?

LGTM -- however, can we change name to sidetag_name or tag_name?

rebased onto 6ff8ee4

3 years ago

@ralph thanks, changed to sidetag_name

Metadata Update from @mvadkert:
- Pull-request untagged with: review-needed
- Pull-request tagged with: review-done

3 years ago

Pull-Request has been merged by mvadkert

3 years ago