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

ver 1.18.0 #5

Closed
wants to merge 222 commits into from
Closed

ver 1.18.0 #5

wants to merge 222 commits into from

Conversation

richm
Copy link
Owner

@richm richm commented Mar 15, 2022

richm and others added 30 commits March 26, 2020 07:27
add copy=tests/setup_module_utils.sh
Add a `--local` switch - this allows you to copy files from your
local clone in order to e.g. test with `tox` locally.
Add support for the yamllint files.
Add support for additional pytest and pytest26 reqs.
Use the `hub` command to allow workflows that use your
local git user with your local git credentials e.g.

As a regular user, perform the usual
clone repo as origin
fork repo as myusername
make a change locally
push the change to my forked repo to a branch
submit a pull request from my forked repo to origin

This also makes the sync script both idempotent and able
to run incrementally.  That is, you can have the following
workflow:

make changes to template
sync the changes to repo R branch B
create a PR from branch B
make more changes to template
sync the changes to repo R branch B
push changes to branch B

This will update the existing PR with a new commit with the
additional changes on branch B

This PR also addresses a major limitation of the sync script -
it does not add new files to git.

add support for --preserve option so that you can use your
local git clone of linux-system-roles without your local
directories being removed
allow the use of the script with the hub command
My previous commit broke automated mode.  This fixes automated mode
and cleans up the code a bit.  There are two new cmdline flags:

`--workdir /path/to/dir` - instead of using the `$WORKDIR` env. var.,
pass it in with this flag.  This will automatically set `PRESERVE=true`
so as not to accidentally remove any directories under your workdir.

`--use-hub` - previously it would use `hub` automatically if found
in the `$PATH`.  Now, you must explicitly set `--use-hub` in order
to use `hub`.
shellcheck is used check shell scripts for many common errors.
shellcheck is built-in to Travis CI
This commit enables Travis CI shellcheck for shell scripts
add support for tox with pylint, pyunit, flake8, black, shellcheck
add support for tox with pylint, pyunit, flake8, black, shellcheck
gist.github.com_sivel/bca2fe56680c76f0eea647f5477dd46b
…at to collections format

[Conversion script]
usage: lsr_role2collection.py [-h] [--namespace NAMESPACE] [--collection COLLECTION]
                              [--dest-path DEST_PATH] [--src-path SRC_PATH] [--role ROLE]
                              [--replace-dot REPLACE_DOT] [--subrole-prefix SUBROLE_PREFIX]

optional arguments:
  -h, --help            show this help message and exit
  --namespace NAMESPACE
                        Collection namespace; default to fedora
  --collection COLLECTION
                        Collection name; default to system_roles
  --dest-path DEST_PATH
                        Path to parent of collection where role should be migrated
  --src-path SRC_PATH   Path to linux-system-roles
  --role ROLE           Role to convert to collection
  --replace-dot REPLACE_DOT
                        If sub-role name contains dots, replace them with the specified value;
                        default to '_'
  --subrole-prefix SUBROLE_PREFIX
                        If sub-role name does not start with the specified value, change the name to
                        start with the value; default to an empty string

[Helper script]
lsr_roles2collections.sh
Adding a role to collection converter tool lsr_role2collection.py
…PACE.COLLECTION_NAME." in

playbook files in the collection converted playbooks directory.
Converting "linux-system-roles." with "NAMESPACE.COLLECTION_NAME." in
lsr_role2collection.py - Supporting README filenames other than README.md and README-extra.md.
  --src-path SRC_PATH   Path to the parent directory of the source role;
                        default to ${HOME}/linux-system-roles
lsr_role2collection.py - Fixing the help for "--src-path SRC_PATH".
Fixing yamllint new-line-at-end-of-file.
  error  no new line character at the end of file (new-line-at-end-of-file)
ansible_role_parser.py - appending '\n' to footer.
- Merging ansible_role_parser.py into lsr_role2collection.py.
- Putting the main part of lsr_role2collection.py into main() function
  and call it 'if __name__ == "__main__"'.
- Adjusting unittests to the refactored functions.
RHELPLAN-56489 - Collection - script - merge 2 python files into one
Adding the default value of --dest-path option in lsr_role2collection.py.
Adding lsr_role2collection.py to README.md.
For the preparation of the task, adding an option to specify the
tests path to copy.
  --tests-dest-path TESTS_DEST_PATH
          Path to parent of tests directory in which rolename directory
          is created and test scripts are copied to the directory;
          default to DEST_PATH/NAMESPACE/COLLECTION
RHELPLAN-42929 - Collections - script - add CI testing for collection
- Renaming the main function to role2collection.
- In the src path, allow a role is located in the directory other than "linux-system-roles".
- Adding --src-owner to specify github owner, e.g., "linux-system-roles".
richm and others added 28 commits December 3, 2021 14:29
Add support for local filter_plugins
…er_plugins

add support for role filter_plugins
* Add initial automate-collections-updates.py

* Refactor the code

Move var definitions, remove redundant list() and print()
Break the code into functions
Use centpkg clone rhel-system-roles instead of URL cloning
Remove logic that checks changelogs

* Fix black formatting issues

Co-authored-by: Richard Megginson <[email protected]>
…es#116)

* Catch warning when Automation Hub is not accessible

* Rename for clarity

* Rename script and dir to update_vendored_collections
* Rename required.yml to vendored_collections.yml because required.yml
gets renamed by `ansible-galaxy collection download`
…ntainer (linux-system-roles#121)

* Add --anonymous for `centpkg clone` to clone over HTTPS

* Remove repo directories before cloning to avoid conflicts

* Remove target-os argument, add centpkg_cmd and fedpkg_cmd

* Change move_tarballs_to_repo to copy_tarballs_to_repo

* Fix replace_sources_in_spec to write the file after replace

* Remove the branch argument, use centos_repo and fedora_repo

* Remove upload_sources, not required for scratch build

* Remove tarballs after script execution

* Add work on fedpkg linux-system-roles repository

* Add the delete_files function

* Improve update_spec to add changelog entry and ready file properly

* Push spec with new tarballs to Fedora

* Configure git credentials, refractor, add comments

* Add updating vendored_collections.yml

* Add pushing to GitHub

* Print different commit messages for Fedora and GitHub

* Do not add remote if exists, checkout anyway if branch exists

* Do not commit tarballs to GitHub, remove function that deletes files

* Remove ansible.netcommon because rhel-system-roles do not vendore it
* Do not add remote for github, print pushing message

* Fix action's destination_branch
This allows us to check for usage of plugins without FQCN.  In
collections, you must use FQCN for non-module plugins such as
filters, tests, etc. that are not built-in.  This applies to plugins
that are defined by the role - Ansible will not automatically look
them up in the collection if the role and the plugin are in
the same collection.  Now you can use --check-fqcn=plugins.

Example:

Found 9 errors
ERROR: not FQCN: vpn_ipaddr at roles/vpn/tasks/mesh_conf.yml:14

The role in the collection should be using namespace.name.vpn_ipaddr
The vpn role needs bindep `openssl` and `dnf`
We do not require `jmespath` or `netaddr` anymore
@richm richm closed this Mar 15, 2022
@richm richm deleted the ver-1.18.0 branch March 15, 2022 17:17
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.

4 participants