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

Added documentation for collectstatic --clear. #42007

Merged
merged 3 commits into from Sep 19, 2018
Merged

Added documentation for collectstatic --clear. #42007

merged 3 commits into from Sep 19, 2018

Conversation

StuartMacKay
Copy link
Contributor

SUMMARY

Documents the clear argument to the django_manage module that can be used to delete existing files when the collectstatic management command is run.

ISSUE TYPE
  • Docs Pull Request
COMPONENT NAME

django_manage

ANSIBLE VERSION
ansible 2.5.5
  config file = /home/stuart/.ansible.cfg
  configured module search path = [u'/home/stuart/.ansible/plugins/modules', u'/usr/share/ansible/plugins/modules']
  ansible python module location = /usr/lib/python2.7/dist-packages/ansible
  executable location = /usr/bin/ansible
  python version = 2.7.12 (default, Dec  4 2017, 14:50:18) [GCC 5.4.0 20160609]
ADDITIONAL INFORMATION

When ansible/ansible-modules-core#1810 was submitted there was no corresponding update to the documentation for the django_manage module.

The PR was merged on 17 Sep 2015 but I do not know what version this was added to. This will need to be added to the change here.

Sample output from anisble when running the command.

changed: [papyrus.local] => {
    "app_path": "/webapps/papyrus/papyrus/backend", 
    "changed": [
        ...
        "Deleting 'rest_framework/js/csrf.js'", 
        "Deleting 'rest_framework/js/bootstrap.min.js'", 
        "Deleting 'rest_framework/js/default.js'", 
        ...
        "Copying '/webapps/papyrus/lib/python3.6/site-packages/rest_framework/static/rest_framework/js/csrf.js'", 
        "Copying '/webapps/papyrus/lib/python3.6/site-packages/rest_framework/static/rest_framework/js/bootstrap.min.js'", 
        "Copying '/webapps/papyrus/lib/python3.6/site-packages/rest_framework/static/rest_framework/js/default.js'", 
        ...
    "cmd": "./manage.py collectstatic --noinput --settings=settings --clear", 
    "out": "Deleting ...
   "pythonpath": null, 
    "settings": "papyrus.settings", 
    "virtualenv": "/webapps/papyrus"
}

Added a description of the --clear argument used with the Django management
command, collectstatic. (When #1810 added this feature the documentation
was not updated).
@ansibot
Copy link
Contributor

ansibot commented Jun 27, 2018

@ansibot ansibot added affects_2.7 This issue/PR affects Ansible v2.7 community_review In order to be merged, this PR must follow the community review workflow. docs This issue/PR relates to or includes documentation. module This issue/PR relates to a module. needs_triage Needs a first human triage before being processed. new_contributor This PR is the first contribution by a new community member. python3 support:community This issue/PR relates to code supported by the Ansible community. labels Jun 27, 2018
@ansibot
Copy link
Contributor

ansibot commented Jun 27, 2018

The test ansible-test sanity --test pep8 [explain] failed with 2 errors:

lib/ansible/modules/web_infrastructure/django_manage.py:59:82: W291 trailing whitespace
lib/ansible/modules/web_infrastructure/django_manage.py:63:15: W291 trailing whitespace

The test ansible-test sanity --test validate-modules [explain] failed with 1 error:

lib/ansible/modules/web_infrastructure/django_manage.py:0:0: E309 version_added for new option (clear) should be 2.7. Currently 0.0

click here for bot help

@ansibot ansibot added ci_verified Changes made in this PR are causing tests to fail. needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. and removed community_review In order to be merged, this PR must follow the community review workflow. labels Jun 27, 2018
@ansibot ansibot removed the ci_verified Changes made in this PR are causing tests to fail. label Jun 27, 2018
@ansibot
Copy link
Contributor

ansibot commented Jun 27, 2018

The test ansible-test sanity --test validate-modules [explain] failed with 1 error:

lib/ansible/modules/web_infrastructure/django_manage.py:0:0: E309 version_added for new option (clear) should be 2.7. Currently 0.0

click here for bot help

@ansibot ansibot added the ci_verified Changes made in this PR are causing tests to fail. label Jun 27, 2018
clear:
description:
- Clear the existing files before trying to copy or link the original file.
- Used only with the 'collectstatic' command. The --noinput argument will be supplied automatically.
Copy link
Contributor

Choose a reason for hiding this comment

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

The C(--noinput) argument will be added automatically.

- Clear the existing files before trying to copy or link the original file.
- Used only with the 'collectstatic' command. The --noinput argument will be supplied automatically.
required: false
default: "no"
Copy link
Contributor

Choose a reason for hiding this comment

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

default: no

@gundalow gundalow removed the needs_triage Needs a first human triage before being processed. label Jun 27, 2018
@ansibot
Copy link
Contributor

ansibot commented Jun 27, 2018

The test ansible-test sanity --test validate-modules [explain] failed with 1 error:

lib/ansible/modules/web_infrastructure/django_manage.py:0:0: E309 version_added for new option (clear) should be 2.7. Currently 0.0

click here for bot help

@StuartMacKay
Copy link
Contributor Author

@gundalow: this is just a documentation update that should be applied retrospectively and not related to an upcoming release. I searched for a changelog that would give me an idea in which version PR for the clear argument was added but did not find anything.

Any ideas on how to deal with this failing test and how to move this forward?

@ansibot ansibot added the stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. label Jul 11, 2018
@gundalow gundalow merged commit f964277 into ansible:devel Sep 19, 2018
@gundalow
Copy link
Contributor

@StuartMacKay What you did was correct so I've merged this. I'll create a backport to get this into stable-2.7

Thank you very much for your first PR, apologies I missed your comment above, unfortunatly I get a lot of GitHub email so I sometime miss the odd PR. Though merged now!

Looking at the module, there seem to be other docs issues

ERROR: lib/ansible/modules/web_infrastructure/django_manage.py:0:0: E317 "app_path" is marked as required but specifies a default. Arguments with a default should not be marked as required
ERROR: lib/ansible/modules/web_infrastructure/django_manage.py:0:0: E317 "command" is marked as required but specifies a default. Arguments with a default should not be marked as required
ERROR: lib/ansible/modules/web_infrastructure/django_manage.py:0:0: E322 "clear" is listed in the argument_spec, but not documented in the module
ERROR: lib/ansible/modules/web_infrastructure/django_manage.py:0:0: E322 "fail_fast" is listed in the argument_spec, but not documented in the module
ERROR: lib/ansible/modules/web_infrastructure/django_manage.py:0:0: E322 "live_server" is listed in the argument_spec, but not documented in the module
ERROR: lib/ansible/modules/web_infrastructure/django_manage.py:0:0: E322 "liveserver" is listed in the argument_spec, but not documented in the module
ERROR: lib/ansible/modules/web_infrastructure/django_manage.py:0:0: E322 "python_path" is listed in the argument_spec, but not documented in the module
ERROR: lib/ansible/modules/web_infrastructure/django_manage.py:0:0: E322 "test_runner" is listed in the argument_spec, but not documented in the module
ERROR: lib/ansible/modules/web_infrastructure/django_manage.py:0:0: E322 "testrunner" is listed in the argument_spec, but not documented in the module
ERROR: lib/ansible/modules/web_infrastructure/django_manage.py:0:0: E322 "virtual_env" is listed in the argument_spec, but not documented in the module
ERROR: lib/ansible/modules/web_infrastructure/django_manage.py:0:0: E325 argument_spec for "clear" defines type="bool" but documentation does not
ERROR: lib/ansible/modules/web_infrastructure/django_manage.py:0:0: E325 argument_spec for "link" defines type="bool" but documentation does not
ERROR: lib/ansible/modules/web_infrastructure/django_manage.py:0:0: E325 argument_spec for "merge" defines type="bool" but documentation does not
ERROR: lib/ansible/modules/web_infrastructure/django_manage.py:0:0: E325 argument_spec for "skip" defines type="bool" but documentation does not
ERROR: lib/ansible/modules/web_infrastructure/django_manage.py:0:0: E326 Value for "choices" from the argument_spec ([]) for "command" does not match the documentation (['cleanup', 'collectstatic', 'flush', 'loaddata', 'migrate', 'runfcgi', 'syncdb', 'test', 'validate'])

In the same PR remove the offending lines from test/sanity/validate-modules/ignore.txt, which CI will tell you about.

gundalow pushed a commit to gundalow/ansible that referenced this pull request Sep 19, 2018
* Added documentation for collectstatic --clear.

Added a description of the --clear argument used with the Django management
command, collectstatic. (When #1810 added this feature the documentation
was not updated).
(cherry picked from commit f964277)
acozine pushed a commit that referenced this pull request Sep 25, 2018
* Added documentation for collectstatic --clear.

Added a description of the --clear argument used with the Django management
command, collectstatic. (When #1810 added this feature the documentation
was not updated).
(cherry picked from commit f964277)
@ansible ansible locked and limited conversation to collaborators Jul 22, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.7 This issue/PR affects Ansible v2.7 ci_verified Changes made in this PR are causing tests to fail. docs This issue/PR relates to or includes documentation. module This issue/PR relates to a module. needs_revision This PR fails CI tests or a maintainer has requested a review/revision of the PR. new_contributor This PR is the first contribution by a new community member. python3 stale_ci This PR has been tested by CI more than one week ago. Close and re-open this PR to get it retested. support:community This issue/PR relates to code supported by the Ansible community.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants