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

Add Package has retry rule #324

Closed
wants to merge 59 commits into from

Conversation

hughsaunders
Copy link

Apt operations are unreliable as they involve network access and
remote servers. To mitigate potential failures, retries should be used.

Jinja2 should not be included in "when" lines. This produces a
warning in Ansible 2.3+
Roles should be expanded to include the prohibition against the
when clauses as well
@evrardjp
Copy link

I welcome this change.

Copy link

@odyssey4me odyssey4me left a comment

Choose a reason for hiding this comment

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

I think this is going to have to be made more generic. In modern ansible the 'package' action module is used, which then passes it to the 'apt' module in the case of a debian system. I think that this lint check should be applied to all package installs, and the check should verify against the 'apt' module (along with yum and others), and against the 'package' task too.

@evrardjp
Copy link

evrardjp commented Feb 15, 2018

I agree this should test the package action plugin, instead of the apt module. But if it's too generic to consider the action plugin, this idea should be extended to the appropriate modules (at least yum and zypper)

Apt operations are unreliable as they involve network access and
remote servers. To mitigate potential failures, retries should be used.

Also updates test_files_not_scanned_twice as the file scanned by
that test now matches two rules.
@hughsaunders
Copy link
Author

Extended to all the package modules, excluding a few that appear to be local only (eg dpkg, and apt_repository).

@evrardjp
Copy link

Probably worth renaming the PR, and making sure it passes tests :)

@hughsaunders
Copy link
Author

Failed job ran for 9 hours, with log output "null" https://api.travis-ci.org/v3/job/341984987/log.txt

@hughsaunders hughsaunders changed the title Add apt has retry rule Add Package has retry rule Feb 16, 2018
@hughsaunders hughsaunders reopened this Feb 16, 2018
@hughsaunders
Copy link
Author

Closed and re-opened to retry tests.

willthames and others added 13 commits March 7, 2018 09:58
Enumerate all the valid modes that we expect to be able to
detect and the invalid modes we expect to detect.

Make the OctalPermissionsRule a lot more readable and remove
a lot of bugs spotted while improving tests and making it readable!
Ansible 2.3+ allows variables to be encrypted *within* YAML files. Pass a default vault_password to the functions that parse YAML.
Include a test to check this raises no exceptions under Ansible 2.3+
Include vault fixes and octal permissions changes
ansible-lint failed to detect tasks with an empty name field. This
commit fixes the issue and adds some tests for it.
…name-field

Fix TaskHasName check for tasks with an empty name field
Also, make options.skip_list a (frozen)set
Zacharias Taubert and others added 14 commits August 27, 2018 12:23
add role dir with os.path.join so correct trailing slash is included
…not-parsed

Fix task files included in roles not parsed
…rom-readme

Remove matchblock as a match type in docs
`replace` module is often another good alternative for sed command
Fixes: ansible#337

Added a check in the _roles_children function if the children that are to be included came out of the dependencies.
If the are from 'dependencies' we don't expect name or key

Added testcases according to the possible notations of the dependencies in the meta/main.yml as stated here: https://docs.ansible.com/ansible/latest/reference_appendices/galaxy.html#dependencies
* PackageIsNotLatestRule: reformat and sort array

* PackageIsNotLatestRule: add more modules

apk, jenkins_plugin, jenkins_plugin, sorcery, win_chocolatey, yarn

List obtained using `ag -l 'state: latest' ansible/lib/`
* update ids and tags, add doc generator

* attempting to correct travis ci tox issues

* added historic ids as tags, updated README, added test case
Use raw strings for regexes, and use `{` rather than `\{`
* Red Hat are now the maintainers
* Bulk update to follow Ansible project guidelines
* Thank willthames for his work
* Detail DCO requirement
* Link to IRC/Mailing lists
* Tidy up markdown files
@gundalow
Copy link
Collaborator

Closing and re-opening to trigger CI.

@gundalow gundalow closed this Oct 29, 2018
@gundalow gundalow reopened this Oct 29, 2018
@awcrosby awcrosby added this to the 4.0.0 milestone Nov 19, 2018
awcrosby and others added 8 commits November 19, 2018 16:28
* Fix double sudo rule output

Signed-off-by: Andrew Crosby <[email protected]>

* Added class to run tests from text, keeping test cases in one file

Signed-off-by: Andrew Crosby <[email protected]>
* Add roadmap

Signed-off-by: Andrew Crosby <[email protected]>

* Updated roadmap

Signed-off-by: Andrew Crosby <[email protected]>
…e#390)

* Fix running with role path containing single or multiple dirs

Signed-off-by: Andrew Crosby <[email protected]>

* Changed fix to check for role files inside rolepath dir

Signed-off-by: Andrew Crosby <[email protected]>

* Add test case for role path deeper than 2 dirs

Signed-off-by: Andrew Crosby <[email protected]>
* Additional default rules for ansible-lint

Signed-off-by: Andrew Crosby <[email protected]>

* Removed 3 rules

Signed-off-by: Andrew Crosby <[email protected]>

* Added connection: local to TaskNoLocalAction rule

Signed-off-by: Andrew Crosby <[email protected]>

* Moved ShellAltPatch check to CommandsInsteadOfModulesRule

Signed-off-by: Andrew Crosby <[email protected]>

* Removed TaskManyArgs rule

Signed-off-by: Andrew Crosby <[email protected]>

* Updated ids to make sequential

Signed-off-by: Andrew Crosby <[email protected]>

* Changed LineTooLongRule to 120 chars

Signed-off-by: Andrew Crosby <[email protected]>

* Added test cases

Signed-off-by: Andrew Crosby <[email protected]>

* Improved rule check if role or not

Signed-off-by: Andrew Crosby <[email protected]>

* Added .yaml in extension check

Signed-off-by: Andrew Crosby <[email protected]>

* Edited local_action suggestion

Signed-off-by: Andrew Crosby <[email protected]>

* Removed 'company' from required meta fields

Signed-off-by: Andrew Crosby <[email protected]>
Apt operations are unreliable as they involve network access and
remote servers. To mitigate potential failures, retries should be used.

Also updates test_files_not_scanned_twice as the file scanned by
that test now matches two rules.
Changed id and tags
Re-ran and sorted generated module list
Refactored test case to be in one file

Signed-off-by: Andrew Crosby <[email protected]>
@awcrosby
Copy link
Contributor

My refactoring of this PR pushed a long commit history, apologies for that, so I have incorporated and merged the refactored edits in #400 - thanks for the contribution!

Refactored edits:

  • Changed id and tags
  • Re-ran and sorted generated module list
  • Refactored test case to be in one file

@awcrosby awcrosby closed this Nov 30, 2018
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.