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

Update main branch content #129

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
d1790d0
devcontainer support
stewartfrancis May 17, 2023
b077e0d
Add launch.json for debugging ansible-test
stewartfrancis May 18, 2023
5bf2e1e
upgrade ansible-lint version
AndrewTwydell Jun 5, 2023
e1608f8
remove unneeded sanity ignores
AndrewTwydell Jun 5, 2023
7a2beb7
resolve doc line-ending lint error
AndrewTwydell Jun 5, 2023
ed06e2c
resolving cmci variable lint errors
AndrewTwydell Jun 5, 2023
8d01b82
add back yamllint
AndrewTwydell Jun 9, 2023
a0a81bc
added CICS version support
KyeMaloy97 Jun 13, 2023
fa3074d
adds new test for bad dataset for CICS version parsing
KyeMaloy97 Jun 13, 2023
e496060
use vault cli tool from devcontainer
AndrewTwydell Jun 15, 2023
b88711c
Update dependency shellcheck-py to v0.9.0.5
Jun 27, 2023
f2597cb
added unit tests for cics version
KyeMaloy97 Jul 20, 2023
aa3cfc4
Update dependency rstcheck to v3.5.0
Jul 25, 2023
47248ea
Update dependency pytest_mock to v3
Jul 26, 2023
05b195b
Bump pytest_mock to highest compatible
andrewhughes101 Jul 31, 2023
815d546
Update dependency rstcheck to v6
Jul 31, 2023
5e57320
Copy build changes from feature/catalog
andrewhughes101 Mar 27, 2024
0e431b5
sanity fixes
andrewhughes101 Mar 27, 2024
ad3f531
Remove cics get version utility
andrewhughes101 Mar 27, 2024
7d9f144
Fix CMCI context and scope when using allowed special chars
andrewhughes101 Mar 27, 2024
cfe978d
Fix string assertion in cmci test
andrewhughes101 Mar 27, 2024
80ff759
fix link in readme
cssh-erik Apr 12, 2024
bdbaa47
Add bandit scanning to CI
andrewhughes101 Apr 12, 2024
fe669d8
skip test directory and exclude false positive in bandit
andrewhughes101 Apr 12, 2024
c00005b
bump lint and ansible-core min version
andrewhughes101 Apr 18, 2024
cfbeebd
release notes and version bump 1.0.6
andrewhughes101 May 7, 2024
8a580bf
Remove support for python < 3.9, Ansible < 2.14
stewartfrancis Apr 10, 2024
b3680b1
remove typing package as its now redundant
andrewhughes101 May 7, 2024
926ee43
pin urlib3 in dependencies
andrewhughes101 May 8, 2024
c844cf2
fixup python v3.6 refs
andrewhughes101 May 8, 2024
db8be54
changelogs and version bump 2.0.0
andrewhughes101 May 8, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .ansible-lint
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,4 @@ skip_list:
- "galaxy[no-changelog]"
- "meta-unsupported-ansible"
- "meta-runtime[unsupported-version]"
- "var-naming[no-role-prefix]"
1 change: 1 addition & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* text=auto
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
.DS_Store
docs/build/
.idea
.vscode/settings.json
__pycache__
venv*
.venv
tests/output
ibm-ibm_zos_cics-*.tar.gz
tests/integration/targets/cics_cmci/cmci-variables.yml
tests/integration/inventory
tests/integration/variables/cmci.yml
17 changes: 17 additions & 0 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
// Use IntelliSense to learn about possible attributes.
// Hover to view descriptions of existing attributes.
// For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
"version": "0.2.0",
"configurations": [
{
"name": "ansible-test",
"type": "python",
"request": "launch",
"program": ".venv/bin/ansible-test",
"console": "integratedTerminal",
"justMyCode": false,
"args": ["integration", "cics_utilities"]
}
]
}
28 changes: 27 additions & 1 deletion CHANGELOG.rst
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,39 @@ ibm.ibm_zos_cics Release Notes
.. contents:: Topics


v2.0.0
======

Release Summary
---------------

Removed support for Python 2.7

Breaking Changes / Porting Guide
--------------------------------

- Python 2.7 is no longer supported as the managed node runtime

v1.0.6
======

Release Summary
---------------

This release contains one bug fix

Bugfixes
--------

- Allows CPSM Scope and Context to contain the following special characters '$', '@', and '#'

v1.0.5
======

Release Summary
---------------

This release contains one bug fix.
This release contains one bug fix

Bugfixes
--------
Expand Down
127 changes: 1 addition & 126 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -60,129 +60,4 @@ You must use your real name and email address.

To save you having to type the above for every commit, Git can add the `Signed-off-by` line. When committing, add the `-s` option to your `git commit` command.

If you haven't signed each commit, then the pull request will fail to pass all checks.

# Development Environment Set-Up Instructions
=============================================

This repository contains an Ansible collection, which is tested using `ansible-test`. This combination of development
tooling requires you to clone the repository to a pretty specific path. As an example, clone the repository to:

```
.../ibm_zos_cics/ansible_collections/ibm/ibm_zos_cics
```

`ansible-test` requires your project to exist in a FQCN-compatible folder structure following the Ansible Collections
conventions. For details, see [this issue](https://github.com/ansible/ansible/issues/60215).

### Create a new virtual environment

Create a virtual environment in the checked out repository. The dir `venv3` is gitignored, and the rest of this
documentation assumes you'll be using that as the name for your virtual environment:

```bash
# Create a new venv called venv3
python3 -m venv venv3

# Activate venv3
source venv3/bin/activate

# Install dev-requirements
pip install -r dev-requirements.txt
```

#### Running the unit tests

You can use the `ansible-test` command to run all of the unit tests:
```bash
# Run unit tests
ansible-test units --python=3.8
```

#### Run Integration Tests

You can also use the `ansible-test` command to run all of the integration tests:

```bash
# Run integration tests
ansible-test integration --python=3.8
```

### PyCharm set-up instructions

If you're planning on using a development environment such as PyCharm to develop `ibm_zos_cics`, you will need to
load the bolded folder in the sample checkout path, in order that your development environment is able to resolve
references to FQCN imports:

<code>.../<b>ibm_zos_cics</b>/ansible_collections/ibm/ibm_zos_cics</code>

#### Make your virtual environment the default Python interpreter for the project

Add the virtual environment as an existing Python interpreter:

- `Preferences > Project: cics-ansible > Python Interpreter > Cog menu > Add.. > {project_root}/ansible_collections/ibm/ibm_zos_cics/env/bin/python`

Set the virtual environment as the default Python interpreter:

- `Preferences > Project: cics-ansible > Python Interpreter > Top dropdown box > Select interpreter you just imported > Apply`

#### Python 2 support

The CMCI modules support running on Python 2.7. To ensure we maintain python 2.7 compatibility, you will also want to
configure a Python 2.7 virtualenv:

```bash
# Ensure virtualenv is installed
python2.7 -m pip install virtualenv

# Create a new virtualenv called venv2
python2.7 -m virtualenv venv2

# Activate venv2
source venv2/bin/activate

# Install dev-requirements
pip install -r dev-requirements.txt
```

Note that a slightly different set of dev requirements is installed for python 2.7, as most of the static analysis tools in
the automated build are run in python 3.8, so are not dev requirements for the python 2.7 environment.

#### Running the build, tests and static analysis locally

A bash script is provided to automate running the static analysis, and tests in both python 2.7 and python 3.8
environments. You will need to have set up `venv`s as described above, with the dev-requirements pre-installed. You will
then be able to run the build, passing the locations of the python 2.7 and python 3.8 `venv`s as environment variables:

```bash
CMCI_PYTHON_38=./venv3 CMCI_PYTHON_27=./venv2 ./build.sh
```

If you are running on Windows, you will need to run the automated build in a docker container produced by building the `Dockerfile` in this repository

#### Configure PyCharm to be able to run Ansible collection unit tests

First, add the `ansible_pytest_collections` plugin to `PYTHONPATH` for your python interpreter. This will be in your
venv if you installed the dependencies using the dev requirements file:

- `Preferences > Project: cics-ansible > Python Interpreter > Cog menu > Show all >
Select your interpreter > Show paths for the selected interpreter (at the bottom) > Plus >
add the path to the 'ansible_test' 'pytest' plugin in your python environment`

- For the sample path:
`.../ibm_zos_cics/ansible_collections/ibm/ibm_zos_cics/venv3/lib/python3.8/site-packages/ansible_test/_data/pytest/plugins`

Next, you'll need to set some default environment variables for pytest launches, to enable the
`ansible_pytest_collections` plugin, and successfully resolve the `ibm_zos_cics` collection locally.

Go to `Run Config Menu > Edit Configurations... > Templates > Python tests > pytest > Environment variables button`

- Set `PYTEST_PLUGINS` to `ansible_pytest_collections`

- Set `ANSIBLE_COLLECTIONS_PATHS` to your project root, i.e. the directory that contains `ansible_collections`. For the
example configuration, that's set to `.../ibm_zos_cics`.

*(You may need to delete existing test configurations in `Python Tests` as they won't have been created with the new
template)*

You should be able to launch the unit tests in `tests/unit/modules` by clicking the play button.
If you haven't signed each commit, then the pull request will fail to pass all checks.
14 changes: 0 additions & 14 deletions Dockerfile

This file was deleted.

4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,11 @@ and ansible-doc to automate tasks in CICS.

## Contributing

We welcome contributions! Find out how in our [contribution guide](CONTRIBUTING.md).
We welcome contributions! Find out how in our [contribution guide](https://github.com/ansible-collections/ibm_zos_cics/blob/main/CONTRIBUTING.md).

## Copyright

© Copyright IBM Corporation 2021, 2023.
© Copyright IBM Corporation 2021, 2024.

## License

Expand Down
71 changes: 0 additions & 71 deletions build.sh

This file was deleted.

7 changes: 5 additions & 2 deletions changelogs/.plugin-cache.yaml
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
objects: {}
objects:
role: {}
plugins:
become: {}
cache: {}
callback: {}
cliconf: {}
connection: {}
filter: {}
httpapi: {}
inventory: {}
lookup: {}
Expand Down Expand Up @@ -37,5 +39,6 @@ plugins:
netconf: {}
shell: {}
strategy: {}
test: {}
vars: {}
version: 1.0.5
version: 2.0.0
17 changes: 17 additions & 0 deletions changelogs/changelog.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,20 @@ releases:
- include-requirements-txt.yaml
- release_summary.yaml
release_date: '2023-05-16'
1.0.6:
changes:
bugfixes:
- Allows CPSM Scope and Context to contain the following special characters
'$', '@', and '#'
release_summary: This release contains one bug fix
fragments:
- 1.0.6.yaml
release_date: '2024-05-07'
2.0.0:
changes:
breaking_changes:
- Python 2.7 is no longer supported as the managed node runtime
release_summary: Removed support for Python 2.7
fragments:
- 2.0.0.yml
release_date: '2024-05-08'
28 changes: 12 additions & 16 deletions dev-requirements.txt
Original file line number Diff line number Diff line change
@@ -1,22 +1,18 @@
# (c) Copyright IBM Corp. 2020,2023
# (c) Copyright IBM Corp. 2020,2024
# Apache License, Version 2.0 (see https://opensource.org/licenses/Apache-2.0)
-r requirements.txt
# ansible-core==2.13.7; python_version >= '3'
# ansible-core==2.11.12; python_version < '3'
junit-xml==1.9 # To get JUnit xml report from ansible-test
pytest_mock==1.12.1
pytest_mock==2.0.0
mock==3.0.5
requests_mock==1.8.0
pytest-xdist==1.34.0 # Need this to work around a problem running ansible-test
pytest==4.6.11; python_version < '3'
pytest==7.2.0; python_version >= '3'
# Non-test requirements (python 3+ only)
pylint==2.5.3; python_version >= '3'
shellcheck-py==0.9.0.2; python_version >= '3'
rstcheck==3.3.1; python_version >= '3'
yamllint==1.29.0; python_version >= '3'
voluptuous==0.13.1; python_version >= '3'
# needed to lint devel ansible version
ansible-lint==6.12.2; python_version >= '3' and python_version < '3.9'
ansible-lint==6.13.1; python_version >= '3.9'
pycodestyle==2.10.0; python_version >= '3'
pytest==7.2.0
# Non-test requirements
pylint==2.5.3
shellcheck-py==0.9.0.5
rstcheck==6.1.2
yamllint==1.32.0
voluptuous==0.13.1
ansible-lint==6.22.0
pycodestyle==2.10.0
bandit==1.7.8
Loading
Loading