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

feat: support of export single project/workflow/job #836

Merged
merged 14 commits into from
Jun 13, 2024

Conversation

przemkalit
Copy link
Contributor

@przemkalit przemkalit commented May 27, 2024

What does this PR do?

The tasks should allow users to easily export all objects related to a specific project.

Currently, filetree_create retrieves every project and other defined objects, which is not desirable in the following use case scenario.

Use case scenario example for a project:

  1. The user creates a project in the QA AAP environment.
  2. The user create many of job templates that use this project
  3. The user wants to promote the project with job templates to the Production environment.
  4. The user uses filetree_create to create a copy of the project with job templates and push the files to a remote repository.
  5. The user uses filetree_read to import the object from the repository.

How should this be tested?

Manual

  1. Provide the variables to the usage of the role:
- name: Get project
  hosts: all 
  roles:
    - role: infra.controller_configuration.filetree_create
      vars:
        project_id: 4
  1. Execute the playbook and check if the only relevant data were exported.

Is there a relevant Issue open for this?

N/A

Other Relevant info, PRs, etc

Request on the forum, that what we want to achieve: https://forum.ansible.com/t/rfe-develop-new-functionality-for-exporting-configurations-filtered-by-project/5220

@djdanielsson djdanielsson requested a review from ivarmu May 28, 2024 18:05
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.

I'm adding comments for job templates that also apply to the other modified objects

roles/filetree_create/README.md Outdated Show resolved Hide resolved
roles/filetree_create/tasks/job_templates.yml Outdated Show resolved Hide resolved
@ivarmu ivarmu added the good first issue Good for newcomers label May 29, 2024
@ivarmu ivarmu self-assigned this May 29, 2024
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.

LGTM

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.

Please, fix the errors listed by the linter

roles/filetree_create/tasks/job_templates.yml Outdated Show resolved Hide resolved
roles/filetree_create/tasks/projects.yml Outdated Show resolved Hide resolved
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.

LGTM

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.

LGTM

Copy link
Contributor

@silvinux silvinux left a comment

Choose a reason for hiding this comment

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

LGTM, but a changelog fragment file needs to be created: changelogs/fragments. Something similar to:


Minor Changes:

  • filetree_create able to filter by project_id, workflow_job_template_id or job_template_id

https://github.com/redhat-cop/controller_configuration/blob/devel/changelogs/config.yaml

@przemkalit
Copy link
Contributor Author

Ok, I've added the missing changelog, anything more to add?

@przemkalit przemkalit requested a review from silvinux June 10, 2024 09:02
Copy link
Contributor

@silvinux silvinux left a comment

Choose a reason for hiding this comment

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

LGTM

@silvinux silvinux merged commit d883211 into redhat-cop:devel Jun 13, 2024
9 of 12 checks passed
przemkalit added a commit to przemkalit/aap_configuration that referenced this pull request Nov 22, 2024
* feat: support of export single project/workflow/job

* fix: missing project_id parameter

* lint: fix indention

* fix: query param wrongly defined

* misc: fix issue witch checks, rename variables, remove unneeded conditions

* rew: modify conditionals for project/job_template/workflow

* fix: missing commas

* fix: missing comma and aligment

* fix: remove trailing whtiespaces

* fix: remove project_id from query of workflow

* fix: wrong parameter in query

* rev: undo project_name support added by mistake

* fix: add missing changelog entry

---------

Co-authored-by: Przemyslaw Kalitowski <[email protected]>
przemkalit added a commit to przemkalit/aap_configuration that referenced this pull request Nov 22, 2024
* feat: support of export single project/workflow/job

* fix: missing project_id parameter

* lint: fix indention

* fix: query param wrongly defined

* misc: fix issue witch checks, rename variables, remove unneeded conditions

* rew: modify conditionals for project/job_template/workflow

* fix: missing commas

* fix: missing comma and aligment

* fix: remove trailing whtiespaces

* fix: remove project_id from query of workflow

* fix: wrong parameter in query

* rev: undo project_name support added by mistake

* fix: add missing changelog entry

---------

Co-authored-by: Przemyslaw Kalitowski <[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