Skip to content
This repository has been archived by the owner on Jun 10, 2024. It is now read-only.

GitLab community pinboard #431

Closed
dagwieers opened this issue Jan 22, 2019 · 49 comments
Closed

GitLab community pinboard #431

dagwieers opened this issue Jan 22, 2019 · 49 comments
Assignees
Labels
gitlab Gitlab community pinboard Communicate with community of like-minded interests

Comments

@dagwieers
Copy link
Contributor

dagwieers commented Jan 22, 2019

Github gitlab issues Github gitlab PRs Gitlab pinboard

We could collectively benefit from forming a Working Group related to GitLab integration. We have quite some contributors and users that are interested in improving this integration.

So this issue is a call to potential interested parties (earlier and existing contributors to Ansible). The benefits of having a Working Group is that members of the Working Group can:

Since we don't currently have GitLab infrastructure for automated testing, collaborating on modules like this is important for the quality of the modules.

@dagwieers dagwieers added pinboard Communicate with community of like-minded interests gitlab Gitlab community labels Jan 22, 2019
@dagwieers

This comment has been minimized.

@Shaps
Copy link

Shaps commented Jan 22, 2019

Interested in this

@dagwieers
Copy link
Contributor Author

dagwieers commented Jan 22, 2019

If you want to actively lead or are interested to be part of this Working Group, add your name to the Wiki page ! If we have a large enough group, we can start our own GitLab Working Group.

I started labeling all the GitLab related issues and PRs so we can more easily track them:

PS If you no longer want to receive any messages from this pinboard, feel free to unsubscribe from this issue ticket.

@marwatk
Copy link

marwatk commented Jan 22, 2019

Added my name to the Wiki. I think one of the first things we need to do is figure out an architecture for how modules should look so we can incrementally move in that direction.

For example, some of the older modules use pyapi-gitlab which hasn't been updated in a year and breaks on newer versions of GitLab. There appear to be multiple efforts to switch (1, 2), but I think a higher level discussion is warranted.

I'm not sure we want to rewrite everything, but having an approach to use for new modules would be ideal and we can work from there to update old ones over time.

@dagwieers
Copy link
Contributor Author

dagwieers commented Jan 22, 2019

@marwatk I will add you to $team_gitlab as well ! ansible/ansible@152d7b6

@drzraf
Copy link

drzraf commented Jan 22, 2019

The more GitLab-Ansible modules there are (which is great), the more a GitLab API abstraction will makes sense. standardizing parameters looks like starting an API (especially with URL, connection, credentials, ... parameters) I believe that's how pyapi-gitlab and python-gitlab started.

In terms of API there is:

I suggested two [pending] PR last year:

Note that at that time the only issue I could see with python-gitlab was the lack of Python 2.6 support.
Other than that, dependencies are requests and six

If will look at OpenStack modules, they seem to take DRY and NIH seriously in that they:

  1. share a common codebase
  2. and are based on openstacklib

About support, I think a module that stop working with GitLab.com API should be either dropped, obsoleted or (better) adapted, even if it's still working with self-hosted instances (which can be running at any version of the API).

@drzraf
Copy link

drzraf commented Jan 22, 2019

About tests, the issue affect all GItLab modules relying on 3rd party services (and there are a lot). That's something core GitLab team should offer some pointers and advises about the road to take.

@Lunik
Copy link

Lunik commented Jan 23, 2019

I'm currently working on refactoring previous gitlab modules to unify the api call, workflow and input parameters ansible/ansible#51141 .

@morph027
Copy link

Chiming in here....reading every tiny bit, but right now i'm quite busy at work. No room for coding, but of course for helping and discussion.

@dj-wasabi
Copy link

Hi all,

I'm not sure if I can help/assist with the coding, but can help with discussion/helping/reviewing/testing of modules.

I'll add my name to the list in the wiki.

Kind regards,
Werner

@dj-wasabi
Copy link

I forgot to ask and I should look around first but, does Ansible have certain standards where a PR should met with? Not that I say shipit and where someone else would say that certain things should be changed?

@dagwieers
Copy link
Contributor Author

@dj-wasabi The process is explained briefly at: https://docs.ansible.com/ansible/devel/community/development_process.html

  • So Shippable CI will test some basic stuff which we automated, these are formal rules and @ansibot will report any issues. The contributor should fix these before community review.
  • A formal review by the community is about:
    • Does the module offer all functionality expected by users/possible by technology, and if incomplete, would the interface (parameters/usage) prevent the module to be extended consistently ?
    • Does it implement check-mode, diff mode ? Is it idempotent ?
    • Does the module have integration tests ? If not, we should urge to write integration tests and review those integration tests to see if they perform all possible tests. These typically test for idempotency and proper return values
    • Is the implementation sound? Obvious cornercases, potential problems, improvements to code?

We expect a shipit when the reviewer did his best at reviewing the code and testing it for real. If you cannot test it because you lack the infrastructure, please say so when approving the PR, but do not add a shipit! Because people that look for merging PRs most likely can't test the module either, and rely on this information to merge. Modules should be verified and tested by the community before being accepted.

@dagwieers
Copy link
Contributor Author

dagwieers commented Jan 23, 2019

Here are two checklists for contributors, but are equally useful for reviewers:

@dj-wasabi
Copy link

Hi @dagwieers

Thank you for your answer(s)! One small thing though, there are no technical "requirements" as in it should pass any pep standard? (I think I read/heard it somewhere that this was coming to Ansible, but not sure if this is already active.)

Thanks in advance.
Kind regards,

Werner

@dagwieers
Copy link
Contributor Author

@dj-wasabi PEP8 testing is enforced by Shippable, like a lot of other sanity tests (and reported back by @ansibot). So if it passes Shippable tests, you know it's fine from that perspective.

@Lunik
Copy link

Lunik commented Jan 24, 2019

I have initiated a wiki page Gitlab-Module-Guidelines

@Lunik
Copy link

Lunik commented Jan 28, 2019

Hi,
Does someone have the time to review this PR ansible/ansible#51141 ?

@dagwieers
Copy link
Contributor Author

dagwieers commented Jan 28, 2019

@Lunik I updated the guidelines to make parameter validate_certs the standard name.
Also I wonder if it wouldn't be better to make https://gitlab.com/ the default server_url ? Rather than making it required (and no default).

@Lunik
Copy link

Lunik commented Jan 28, 2019

Also I wonder if it wouldn't be better to make https://gitlab.com/ the default server_url ? Rather than making it required (and no default).

If it was Github, it seems legit. But for Gitlab, I don't know 🤔
I'm not against so I can add that to my PR.

@Shaps
Copy link

Shaps commented Jan 30, 2019

@dagwieers I tend to use gitlab 90% from self-hosted and the rest is hosted on gitlab.com, I'm likely weird, if you think it's what people use most I'm +1 to it.

@dagwieers
Copy link
Contributor Author

dagwieers commented Jan 30, 2019

@Shaps The only reason for me to propose it as the default is because it's the only real option if we wanted a default. And for people using gitlab.com it wouldn't require this parameter. But if you think it is confusing for (the majority? of) users as they may be using the wrong target and would not understand why things are failing, I would be inclined to NOT do this and explicitly ask for this.

Leave it up to you guys to decide...

@dagwieers
Copy link
Contributor Author

The amount of support here is great. And in the meantime both @Shaps and @Lunik stepped forward to lead the Gitlab Working Group. My role will be to help out where I can to advance the Gitlab integration.

We are still learning how these communities can help improve contributors and users. I started to write down how I envision the different roles in Working Groups. Feedback and ideas are always welcome.

There is room for more people taking up the Lead role, so if you think you have some extra cycles to spare to help grow this community, let me know.

The Ansible v2.8 freeze is nearing and we have about a month to get as much as possible reviewed and fixed. Feel free to reach out to @Shaps, @Lunik, @gundalow and me if you need any help. Let's make the upcoming release the best one for Gitlab ever!

@Lunik
Copy link

Lunik commented Jan 31, 2019

I think ansible/ansible#44055 and ansible/ansible#44069 is not related to gitlab

@Lunik

This comment has been minimized.

@drzraf

This comment has been minimized.

@dagwieers

This comment has been minimized.

@drzraf

This comment has been minimized.

@Lunik

This comment has been minimized.

@dagwieers

This comment has been minimized.

@Lunik

This comment has been minimized.

@dagwieers

This comment has been minimized.

@Lunik
Copy link

Lunik commented Feb 7, 2019

As mentioned in ansible/ansible#39991 (comment), should we add alias on this module to rename it gitlab_hook instead of gitlab_hooks ?

FMI, link to the documentation https://docs.ansible.com/ansible/latest/dev_guide/module_lifecycle.html#changing-a-module-name

@dagwieers

This comment has been minimized.

@Lunik
Copy link

Lunik commented Feb 8, 2019

@dagwieers

It was never released in an Ansible release, so I would not bother with aliases, but simple rename the module.

gitlab_hooks module is here since Ansible 2.6 so I don't understand what you mean.

gitlab_hooks and gitlab_webhook have exactly the same purpose with different approach.

Pros/Cons gitlab_webhook

Pros Cons
Better handling of hook event in module parameters. Using only on option of type list No backward compatibilities with gitlab_hooks
Allow to delete hook by is ID Could be confusing. Creating the hook with url deleting it with hook_id or url.
Usage of deprecated parameters since ansible/ansible#51141 (server_url, login_user, ...)
Usage of the python-gitlab library
Module parameter solo diverts user from best practice. It allow to have multiple hooks pointing to the same url. There is no need since hook can have multiple events
Need to be reviewed with new best practice like missing_required_lib and docs_fragements

@dagwieers

This comment has been minimized.

@dagwieers dagwieers changed the title Gitlab community pinboard GitLab community pinboard Feb 8, 2019
@Shaps
Copy link

Shaps commented Mar 6, 2019

Re- #40053
According to @sivel's comment the gitlab_service module violates the module guidelines and would not be accepted. With this in mind how do we want to proceed?

@drzraf
Copy link

drzraf commented Mar 7, 2019

I'd think it's premature to take this sole comment (which is one interpretation of the guidelines in the context of a specific MR), as a kind of legal-precedent. #40053 is far from closed :)

@gundalow
Copy link
Contributor

ansible/ansible#53897 Gitlab runner inventory plugin

@Lunik
Copy link

Lunik commented Apr 16, 2019

New issues have popped up about contains call to Display.deprecated or AnsibleModule.deprecated
How should we fix them ? Is there a porting guide somewhere in the documentation ?

ansible/ansible#55313
ansible/ansible#55314
ansible/ansible#55315
ansible/ansible#55316
ansible/ansible#55317

@dagwieers
Copy link
Contributor Author

@Lunik Either fixing the issue (i.e. float 2.10 is converted to 2.1) or removing the statements because the deprecation window has ended (i.e. feature is removed in v2.9).

@Lunik
Copy link

Lunik commented Apr 17, 2019

All issues have been fixed and back-ported to Ansible 2.8

@Lunik
Copy link

Lunik commented May 28, 2019

Can someone make an additional review of ansible/ansible#56574 ?

@waheedi
Copy link

waheedi commented Jun 25, 2019

Hi @Lunik i went through #56574 and ran the tests successfully on Ubuntu 18.04 machine. Have not really dived into the code though.

@Lunik
Copy link

Lunik commented Oct 8, 2019

Can someone make an additional review on ansible/ansible#60425 ?

@Lunik
Copy link

Lunik commented Oct 14, 2019

Can someone make an additional review on ansible/ansible#60425 ?

This issue begin to be more and more critical with the time, people start complaining #63448

@Lunik
Copy link

Lunik commented Nov 21, 2019

Can we discuss about the relevance of actual unit tests ?
They are just mock API responses from GitLab API.
Can we just replace them by the integration tests we already have ?

@Shaps
Copy link

Shaps commented Dec 5, 2019

@Lunik I think the only reason we still have not moved to integration tests is because we don't really have a platform where to test the stuff on. I had started doing some work to implement this with ansible-test but life got in the way and haven't had a chance to finalise it.
I believe a good way forward would be to have the integration tests anyway, and keep them disabled in CI, at least we can still manually run them when required.

@Shaps
Copy link

Shaps commented Apr 14, 2020

@Lunik All the gitlab modules have now been migrated to the community.general collection, we should make an effort on updating them so they are "collection-compatible". Do you think you're going to have some time to spend on it? I think I can spare some time otherwise :)

@Lunik
Copy link

Lunik commented Apr 15, 2020

@Shaps What are you thinking about ? With the migration there should be a backward compatibility ?
Are you proposing to create our own collection for GitLab modules ?

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
gitlab Gitlab community pinboard Communicate with community of like-minded interests
Projects
None yet
Development

No branches or pull requests

10 participants