8000 WIP: New module: GitLab service by drzraf · Pull Request #667 · ansible-collections/community.general · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
8000

WIP: New module: GitLab service #667

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

Closed
wants to merge 3 commits into from

Conversation

drzraf
Copy link
Contributor
@drzraf drzraf commented Jul 17, 2020
SUMMARY

New module: Gitlab integration services

Fixes ansible/ansible#40053

ISSUE TYPE
  • New Module Pull Request
COMPONENT NAME

gitlab_service

ADDITIONAL INFORMATION

This module provides a way to setup Gitlab integration services using Ansible and supports all services defined by Gitlab.com API (and their corresponding parameters) as of 2020/07/09.

Known bugs:

Needs work:

  • The active state of a service could not be set using the API. Use state=absent to completely remove the service configuration instead of deactivating it. But some work happened recently on GitLab side, it may be fixed by now.
EXTENDED DEFINITION OF SERVICE
  • Their validation is done by doing a redundant initialization of the AnsibleModule() and modifying the argument spec meanwhile.

  • The extended definition of services and their suboptions (name, required or not, type) is generated from Gitlab upstream file the 2020/07/09.

@drzraf drzraf changed the title New module: Gitlab service WIP: New module: Gitlab service Jul 17, 2020
@drzraf drzraf changed the title WIP: New module: Gitlab service WIP: New module: GitLab service Jul 17, 2020
@ansibullbot ansibullbot added WIP Work in progress affects_2.10 module module needs_triage new_contributor Help guide this first time contributor new_module New module new_plugin New plugin labels Jul 17, 2020
@ansibullbot
Copy link
Collaborator

The test ansible-test sanity --test compile --python 2.6 [explain] failed with 1 error:

plugins/modules/gitlab_service.py:315:60: SyntaxError: return {value + '_events': bool(value in events) for value in self.HOOK_EVENTS if supported_events is None or value in supported_events}

The test ansible-test sanity --test import --python 2.6 [explain] failed with 1 error:

plugins/modules/gitlab_service.py:315:60: traceback: SyntaxError: invalid syntax

The test ansible-test sanity --test validate-modules [explain] failed with 3 errors:

plugins/modules/gitlab_service.py:0:0: doc-elements-mismatch: Argument 'events' in argument_spec specifies elements as str,but elements is not documented
plugins/modules/gitlab_service.py:0:0: doc-required-mismatch: Argument 'api_url' in argument_spec is required, but is not documented as being required
plugins/modules/gitlab_service.py:0:0: doc-required-mismatch: Argument 'service' in argument_spec is not required, but is documented as being required

The test ansible-test sanity --test compile --python 2.6 [explain] failed with 1 error:

plugins/modules/gitlab_service.py:315:60: SyntaxError: return {value + '_events': bool(value in events) for value in self.HOOK_EVENTS if supported_events is None or value in supported_events}

The test ansible-test sanity --test import --python 2.6 [explain] failed with 1 error:

plugins/modules/gitlab_service.py:315:60: traceback: SyntaxError: invalid syntax

The test ansible-test sanity --test validate-modules [explain] failed with 3 errors:

plugins/modules/gitlab_service.py:0:0: doc-elements-mismatch: Argument 'events' in argument_spec specifies elements as str,but elements is not documented
plugins/modules/gitlab_service.py:0:0: doc-required-mismatch: Argument 'api_url' in argument_spec is required, but is not documented as being required
plugins/modules/gitlab_service.py:0:0: doc-required-mismatch: Argument 'service' in argument_spec is not required, but is documented as being required

The test ansible-test sanity --test compile --python 2.6 [explain] failed with 1 error:

plugins/modules/gitlab_service.py:315:60: SyntaxError: return {value + '_events': bool(value in events) for value in self.HOOK_EVENTS if supported_events is None or value in supported_events}

The test ansible-test sanity --test import --python 2.6 [explain] failed with 1 error:

plugins/modules/gitlab_service.py:315:60: traceback: SyntaxError: invalid syntax

click here for bot help

@ansibullbot ansibullbot added the ci_verified Push fixes to PR branch to re-run CI label Jul 17, 2020
@drzraf
Copy link
Contributor Author
drzraf commented Jul 17, 2020

As stated in the original task I won't go through the horrible hassle to get a Python 2.6 toolchain for the sole purpose of lint'ing a module that will never be realistically used with such a version.

@felixfontein
Copy link
Collaborator

There's no need to install a 2.6 toolchain. You can either run ansible-test sanity --docker -v, which includes among others a Python 2.6 in the container, or you can use CI. In any case, if the module does not conform to Python 2.6 syntax, it will not be merged.

In any case, the module must not live in plugins/modules/, but in a subdirectory. You need to create a symlink from plugins/modules/ to the actual module.

@Andersson007
Copy link
Contributor

@drzraf any updates on this?
we expanded gitlab_team a little bit, so i hope, there will be people to review the module. If not, i think, community team will review this

@drzraf
Copy link
Contributor Author
drzraf commented Oct 23, 2020

Screenshot from 2020-10-22 20-10-17

...

Then I tried to get the good old local testing (python -m ansible.modules.my_test /tmp/args.json), but I don't see how (if?) it's possible nowadays.

@ansibullbot
Copy link
Collaborator

@ansibullbot ansibullbot added gitlab plugins plugin (any type) source_control and removed ci_verified Push fixes to PR branch to re-run CI needs_triage labels Oct 23, 2020
@ansibullbot
Copy link
Collaborator

The test ansible-test sanity --test validate-modules [explain] failed with 3 errors:

plugins/modules/source_control/gitlab/gitlab_service.py:0:0: doc-elements-mismatch: Argument 'events' in argument_spec specifies elements as str,but elements is not documented
plugins/modules/source_control/gitlab/gitlab_service.py:0:0: doc-required-mismatch: Argument 'api_url' in argument_spec is required, but is not documented as being required
plugins/modules/source_control/gitlab/gitlab_service.py:0:0: doc-required-mismatch: Argument 'service' in argument_spec is not required, but is documented as being required

The test ansible-test sanity --test validate-modules [explain] failed with 3 errors:

plugins/modules/source_control/gitlab/gitlab_service.py:0:0: doc-elements-mismatch: Argument 'events' in argument_spec specifies elements as str,but elements is not documented
plugins/modules/source_control/gitlab/gitlab_service.py:0:0: doc-required-mismatch: Argument 'api_url' in argument_spec is required, but is not documented as being required
plugins/modules/source_control/gitlab/gitlab_service.py:0:0: doc-required-mismatch: Argument 'service' in argument_spec is not required, but is documented as being required

click here for bot help

@ansibullbot ansibullbot added the ci_verified Push fixes to PR branch to re-run CI label Oct 23, 2020
@ansibullbot ansibullbot removed the ci_verified Push fixes to PR branch to re-run CI label Oct 23, 2020
Copy link
Collaborator
@felixfontein felixfontein left a comment

Choose a reason for hiding this comment

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

Please note that all new modules must come with tests, i.e. unit and/or integration tests.

@ansibullbot
Copy link
Collaborator

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

plugins/modules/source_control/gitlab/gitlab_service.py:398:8: undefined-variable: Undefined variable 'base_specs'
plugins/modules/source_control/gitlab/gitlab_service.py:400:12: undefined-variable: Undefined variable 'base_specs'

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

plugins/modules/source_control/gitlab/gitlab_service.py:361:13: E126: continuation line over-indented for hanging indent

The test ansible-tes 8000 t sanity --test pylint [explain] failed with 2 errors:

plugins/modules/source_control/gitlab/gitlab_service.py:398:8: undefined-variable: Undefined variable 'base_specs'
plugins/modules/source_control/gitlab/gitlab_service.py:400:12: undefined-variable: Undefined variable 'base_specs'

The test ansible-test sanity --test validate-modules [explain] failed with 4 errors:

plugins/modules/source_control/gitlab/gitlab_service.py:0:0: doc-elements-mismatch: Argument 'events' in argument_spec specifies elements as str,but elements is not documented
plugins/modules/source_control/gitlab/gitlab_service.py:0:0: doc-required-mismatch: Argument 'service' in argument_spec is not required, but is documented as being required
plugins/modules/source_control/gitlab/gitlab_service.py:0:0: mutually_exclusive-unknown: mutually_exclusive contains terms which are not part of argument_spec: api_token
plugins/modules/source_control/gitlab/gitlab_service.py:0:0: required_one_of-unknown: required_one_of contains terms which are not part of argument_spec: api_token

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

plugins/modules/source_control/gitlab/gitlab_service.py:361:13: E126: continuation line over-indented for hanging indent

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

plugins/modules/source_control/gitlab/gitlab_service.py:398:8: undefined-variable: Undefined variable 'base_specs'
plugins/modules/source_control/gitlab/gitlab_service.py:400:12: undefined-variable: Undefined variable 'base_specs'

The test ansible-test sanity --test validate-modules [explain] failed with 4 errors:

plugins/modules/source_control/gitlab/gitlab_service.py:0:0: doc-elements-mismatch: Argument 'events' in argument_spec specifies elements as str,but elements is not documented
plugins/modules/source_control/gitlab/gitlab_service.py:0:0: doc-required-mismatch: Argument 'service' in argument_spec is not required, but is documented as being required
plugins/modules/source_control/gitlab/gitlab_service.py:0:0: mutually_exclusive-unknown: mutually_exclusive contains terms which are not part of argument_spec: api_token
plugins/modules/source_control/gitlab/gitlab_service.py:0:0: required_one_of-unknown: required_one_of contains terms which are not part of argument_spec: api_token

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

plugins/modules/source_control/gitlab/gitlab_service.py:361:13: E126: continuation line over-indented for hanging indent

click here for bot help

@ansibullbot ansibullbot added the ci_verified Push fixes to PR branch to re-run CI label Oct 23, 2020
@felixfontein
Copy link
Collaborator

@drzraf are you still working on this?

needs_info

@ansibullbot ansibullbot added needs_info This issue requires further information. Please answer any outstanding questions stale_ci CI is older than 7 days, rerun before merging labels Feb 26, 2021
@felixfontein
Copy link
Collaborator

Closing since there was no more reaction. @drzraf if you're interested again in working on this, please ping me. If someone else is interested in continuing this PR, please also write it here so we can coordinate.

@drzraf
Copy link
Contributor Author
drzraf commented Mar 29, 2021

/ping @felixfontein (Resolved all the comments again)

(Currently docker-pulling the gigabytes of software necessary to test the changes)

@felixfontein
Copy link
Collaborator

@drzraf since you force-pushed, GitHub does not let me open this PR anymore.

drzraf pushed a commit to drzraf/community.general that referenced this pull request Feb 17, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ci_verified Push fixes to PR branch to re-run CI gitlab module module needs_info This issue requires further information. Please answer any outstanding questions new_contributor Help guide this first time contributor new_module New module new_plugin New plugin plugins plugin (any type) source_control stale_ci CI is older than 7 days, rerun before merging WIP Work in progress
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants
0