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

Roles import optimatization by modifying the export + 2 minor bugs #884

Merged

Conversation

przemkalit
Copy link
Contributor

What does this PR do?

This PR changes the way roles are exported in the current version of the collection. Previously, every single permission role was added as a separate entry. I've modified it so that objects related to a role are matched with that role. As a result, the entry for a role is now presented as follows.

controller_roles:
  - team: "Y"
    projects:
      - "A"
      - "B"
      - "C"
      - "D"
      - "E"
      - "F"
    role: "update"
  - team: "Y"
    projects:
      - "A"
      - "B"
      - "C"
      - "D"
      - "E"
      - "F"
    role: "read"

Thanks to that, the number of requests sent to the API is decreasing.

Let me know what you think. If you have any suggestions, I would be grateful.

Additionally, there are two changes: one related to the approval role, which I fixed for teams but not for users, and another issue with the job template admin, project admin, and similar roles. These roles are exported without underscores, which prevents them from being imported.

How should this be tested?

  1. Use filetree_create to create export.
  2. Use filetree_read to load export.
  3. Use dispatch to import.

Is there a relevant Issue open for this?

N/A

Other Relevant info, PRs, etc

#876

@przemkalit przemkalit requested a review from a team as a code owner July 31, 2024 11:11
@przemkalit przemkalit changed the title Roles export optimatization + 2 minor bugs Roles import optimatization by modifying the export + 2 minor bugs Jul 31, 2024
@djdanielsson
Copy link
Collaborator

thoughts?
@silvinux
@ivarmu
@adonisgarciac

Copy link
Contributor

@ivarmu ivarmu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good idea! LGTM

@ivarmu ivarmu enabled auto-merge (squash) August 5, 2024 15:07
@djdanielsson
Copy link
Collaborator

if you update the branch I will merge this

Copy link
Contributor

@adonisgarciac adonisgarciac left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@djdanielsson djdanielsson disabled auto-merge August 6, 2024 12:55
@djdanielsson djdanielsson merged commit c966615 into redhat-cop:devel Aug 6, 2024
3 of 6 checks passed
przemkalit added a commit to przemkalit/controller_configuration that referenced this pull request Nov 22, 2024
…edhat-cop#884)

* misc: roles export optimization, fix approval role for users, fix admin roles

* fix: typo

* fix: add missing changelog

* fix: remove new lines

* fix: add missing new line

---------

Co-authored-by: Przemyslaw Kalitowski <[email protected]>
Co-authored-by: Ivan Aragonés Muniesa <[email protected]>
Co-authored-by: David Danielsson <[email protected]>
przemkalit added a commit to przemkalit/controller_configuration that referenced this pull request Nov 22, 2024
…edhat-cop#884)

* misc: roles export optimization, fix approval role for users, fix admin roles

* fix: typo

* fix: add missing changelog

* fix: remove new lines

* fix: add missing new line

---------

Co-authored-by: Przemyslaw Kalitowski <[email protected]>
Co-authored-by: Ivan Aragonés Muniesa <[email protected]>
Co-authored-by: David Danielsson <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants