Skip to content

Remove inheritance with the same name, too#50

Open
ahills wants to merge 5 commits intoktdreyer:masterfrom
ahills:inheritance-delete-by-name
Open

Remove inheritance with the same name, too#50
ahills wants to merge 5 commits intoktdreyer:masterfrom
ahills:inheritance-delete-by-name

Conversation

@ahills
Copy link
Copy Markdown
Collaborator

@ahills ahills commented Aug 27, 2019

Koji won't allow a tag's parents to include two of the same name nor priority, so remove matches for either, instead of just priority. This will allow changing a parent's priority when another parent already has that priority, by removing both inheritance links before setting the desired one.

It also allows removing inheritance link by either parent tag name or priority, as well as both (exact match).

@ktdreyer
Copy link
Copy Markdown
Owner

I will test this tomorrow

Comment thread library/koji_tag_inheritance.py Outdated
Comment thread library/koji_tag_inheritance.py
Comment thread module_utils/common_koji.py
Comment thread library/koji_tag_inheritance.py
Koji won't allow a tag's parents to include two of the same name nor priority,
so remove matches for either, instead of just priority. This will allow
changing a parent's priority when another parent already has that priority, by
removing both inheritance links before setting the desired one.

It also allows removing inheritance link by either parent tag name or priority,
as well as both (exact match).
@ahills
Copy link
Copy Markdown
Collaborator Author

ahills commented Nov 20, 2019

Rebased on #68, improved commit message and documentation, and expanded test coverage.

Prior to this change, we only tested deleting by parent_tag name.

Add tests to cover deleting by priority as well. Now we have four
scenarios:

  delete-1: Delete by parent_tag name only
  delete-2: Delete by priority only
  delete-3: Delete by parent_tag name and priority
  delete-4: Do *not* delete if parent_tag name and priority fail to
            match
@ktdreyer
Copy link
Copy Markdown
Owner

I think this is a lot easier to review now, thanks. If you rebase on master again, it'll be easier to see the single commit.

tests/integration/koji_tag_inheritance/update-1.yml fails now:
xmlrpc.client.Fault: <Fault 1000: 'Changes should not contain duplicated parent_id(5)'>

We need more integration tests for this behavior, so I added them as a pull request to your branch: https://github.com/ahills/koji-ansible/pull/1

Andrew Hills and others added 3 commits November 21, 2019 10:02
Koji won't allow a tag's parents to include two of the same name nor
priority, so remove matches for either, instead of just priority. This
will allow changing a parent's priority.
tests: more delete tests for koji_tag_inheritance
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants