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

Gitlab #299

Merged
merged 10 commits into from Aug 20, 2016
Merged

Gitlab #299

merged 10 commits into from Aug 20, 2016

Conversation

@k0nserv
Copy link
Member

k0nserv commented Jul 4, 2016

Opening this PR for tracking purposes and comments from everyone else. There's still some work that needs to be finished up

  • Implement and adopt tests
  • Make sure we get a new version of the gitlab gem issued
  • For GitLab CI to work we need to convince/implement some changes in GitLab

cc @orta, @connorshea, @hjanuschka, @jk

# The title of the Pull Request
# @return String
#
def pr_title

This comment has been minimized.

Copy link
@orta

orta Jul 4, 2016

Member

IMO, these should move to the gitlab vernacular - mr_title ( documentation around this will be handled fine 👍 )

This comment has been minimized.

Copy link
@k0nserv

k0nserv Jul 4, 2016

Author Member

Agreed :)

This comment has been minimized.

Copy link
@k0nserv

k0nserv Jul 4, 2016

Author Member

Unless there's a need for a common interface

This comment has been minimized.

Copy link
@orta

orta Jul 4, 2016

Member

IMO, I don't think so, for Danger::RequestSources::GitLab there should be, ( you could add method aliases though, so that people can C&P examples that may reference the github names? I'd be on board with that. )

This comment has been minimized.

Copy link
@k0nserv

k0nserv Jul 4, 2016

Author Member

Yeah it's only used by the matching request source as of now so


module Danger
module RequestSources
class GitHub < RequestSource
include Danger::Helpers::CommentsHelper

This comment has been minimized.

Copy link
@orta

orta Jul 4, 2016

Member

👍

@k0nserv k0nserv force-pushed the k0nserv:gitlab branch from fe435c9 to 2eca8c0 Jul 4, 2016
@DangerCI
Copy link

DangerCI commented Jul 4, 2016

3 Errors
🚫 Please include a CHANGELOG entry.
You can find it at CHANGELOG.md.
🚫 Failing due to documentation issues, see below.
🚫 The core plugins are not at 100% doc’d - see below:
Please include a CHANGELOG entry. You can find it at CHANGELOG.md.
Please include a CHANGELOG entry. You can find it at CHANGELOG.md.

Please include a CHANGELOG entry. You can find it at CHANGELOG.md.

1 Warning
⚠️ .gemspec modified
External contributor has edited the Gemspec
Nice work.
@k0nserv is not a contributor yet, would you like to join the Danger org?

Core Docs Errors

[!] Failed

Errors

Warnings

Files:           5
Modules:         1 (    0 undocumented)
Classes:         5 (    1 undocumented)
Constants:       0 (    0 undocumented)
Attributes:      0 (    0 undocumented)
Methods:        48 (    2 undocumented)
 94.44% documented

Undocumented Objects:

(in file: lib/danger/danger_core/plugins/dangerfile_gitlab_plugin.rb)
Danger::DangerfileGitLabPlugin
Danger::DangerfileGitLabPlugin.new
Danger::DangerfileGitLabPlugin.instance_name

Generated by 🚫 danger

@k0nserv
Copy link
Member Author

k0nserv commented Jul 4, 2016

On the topic of the gitlab gem I've reached out to Narkos over email. He is the registered owner of the gem on https://rubygems.org. Issuing a 3.7.0 of gitlab is currently the largest blocker for this to be merged

@k0nserv k0nserv force-pushed the k0nserv:gitlab branch 3 times, most recently from a51e545 to 9c3ddc0 Jul 4, 2016
@orta orta mentioned this pull request Jul 7, 2016
@orta
Copy link
Member

orta commented Jul 7, 2016

@k0nserv any reply from Narkos?

@k0nserv
Copy link
Member Author

k0nserv commented Jul 7, 2016

No word from Narkos yet. You wanna try the Rubygems route?

@k0nserv
Copy link
Member Author

k0nserv commented Jul 7, 2016

Might be possible to convince them to give @asedge push access

@hjanuschka
Copy link

hjanuschka commented Jul 7, 2016

i would be scared if it would work!

how about forking it to gitlab-official or gitlab-gitlab?

@orta
Copy link
Member

orta commented Jul 7, 2016

I think it's better we see if we can get either the attention of asedge, or someone who works at GitLab, it's a pretty clear-cut choice to say that they should have access in the absence of Narkos.

@connorshea
Copy link
Contributor

connorshea commented Jul 7, 2016

I'm undecided as to whether we should try to get control of the gem or create a new one, I've asked fellow GitLabbers for their input.

It'd also be good to have your thoughts, @asedge, seeing as you're the primary maintainer currently.

@k0nserv k0nserv force-pushed the k0nserv:gitlab branch 2 times, most recently from c4129a6 to 312e59b Jul 7, 2016
@k0nserv
Copy link
Member Author

k0nserv commented Jul 7, 2016

@orta Do you wanna exclude GitLab CI on account of it not being supported as of now?

@orta
Copy link
Member

orta commented Jul 7, 2016

You mean merge this, but not let the code-paths be accessible? That can work for me

@k0nserv
Copy link
Member Author

k0nserv commented Jul 7, 2016

Either that or not merge it at all. Until they support some way of exposing the MR id in GitLab CI Danger won't work at all, even after that they need to support triggering builds on comments/edits for full support

@k0nserv
Copy link
Member Author

k0nserv commented Jul 7, 2016

All though if we include it as it stands right now people are free to build small servers that interact with GitLab's build hooks to expose the correct env variables

@justMaku
Copy link
Member

justMaku commented Jul 7, 2016

I'd merge it and allow people to build their own workflows, even if GitLab CI doesn't work now, people can still use Jenkins or any other form of CI to trigger the build.

@k0nserv
Copy link
Member Author

k0nserv commented Jul 7, 2016

The question is not about other CI tools though, it's specifically about Danger::CISource::GitlabCI.

@orta
Copy link
Member

orta commented Jul 7, 2016

Aye, I'm on the let's merge it, but comment out the Danger::CISource::GitlabCI - it'll end up in the autogenerated docs on the website

@justMaku
Copy link
Member

justMaku commented Jul 7, 2016

I also believe that assuming that Danger only works on PRs is wrong as in fact danger could work on any given changeset. We need to start thinking about removing that tight coupling somehow and maybe even move out PR updaters to a plugin.

@orta
Copy link
Member

orta commented Jul 7, 2016

I also believe that assuming that Danger only works on PRs is wrong as in fact danger could work on any given changeset.

Could, yes, I guess I can see some usage as a pre-linter, but it might not be worth the overhead for support.

@k0nserv k0nserv force-pushed the k0nserv:gitlab branch 2 times, most recently from 1238b3d to 634a525 Jul 7, 2016
@orta
Copy link
Member

orta commented Aug 16, 2016

There's also the question of organization danger files which isn't implemented yet

Don't do this ATM, I've already removed it in one PR - #418 - I'm not sure what its replacement should look like yet

@connorshea
Copy link
Contributor

connorshea commented Aug 16, 2016

Hey all, we've gotten the current maintainer of the GitLab gem able to ship new releases! 3.7.0 is now out! https://rubygems.org/gems/gitlab

@orta
Copy link
Member

orta commented Aug 17, 2016

🎉

@k0nserv k0nserv force-pushed the k0nserv:gitlab branch 2 times, most recently from 336a98e to 9563012 Aug 18, 2016
@k0nserv
Copy link
Member Author

k0nserv commented Aug 20, 2016

I believe this should be ready for review now. I haven't written any code to update the status of the merge request yet, but I'd prefer to merge first and then add this

@k0nserv
Copy link
Member Author

k0nserv commented Aug 20, 2016

The other thing that remains is updating CI sources that support GitLab. I don't believe this to be a blocker for the merge either

@k0nserv k0nserv force-pushed the k0nserv:gitlab branch from 9563012 to 31add08 Aug 20, 2016
# The new method uses a more robust data-danger-table
# tag instead.
match = GITHUB_OLD_REGEX.match(table)
return match if match

This comment has been minimized.

Copy link
@orta

orta Aug 20, 2016

Member

👍

:should_remove_source_branch, :force_remove_source_branch
].each do |key|
key_present = plugin.pr_json.key?(key.to_s)
expect(key_present).to be_truthy, "Expected key #{key} not found"

This comment has been minimized.

Copy link
@orta

orta Aug 20, 2016

Member

Nitpick: This might be over-testing, you're mostly testing the json parser here, and as the API changes - the expectations in this test will become out of sync with what the stubbed JSON says are reality

This comment has been minimized.

Copy link
@orta

orta Aug 20, 2016

Member

It definitely looks cool though


describe Danger::RequestSources::GitLab, host: :gitlab do
let(:env) { stub_env }
let(:g) { Danger::RequestSources::GitLab.new(stub_ci, env) }

This comment has been minimized.

Copy link
@orta

orta Aug 20, 2016

Member

This let helper is nice

File.open(dir + "/file2", "w") {}
`git add .`
`git commit -m "another"`
`git remote add origin git@gitlab.com:k0nserv/danger-test.git`

This comment has been minimized.

Copy link
@orta

orta Aug 20, 2016

Member

👍

@orta
Copy link
Member

orta commented Aug 20, 2016

OK, so yeah, this looks good, I have only minor nitpicks about the tests - but that's not a blocker for me at all. I'm going to merge this into another branch on danger ( I want to be able to deploy master whenever ) so I can get this rebased, documented and green. A new PR will be coming in soon, once I get back to my main computer.

This has been a bunch of work from a quite a few developers, thanks to all of you. 💯

@orta orta changed the base branch from master to gitlab_docs Aug 20, 2016
@orta orta merged commit 5f2572c into danger:gitlab_docs Aug 20, 2016
1 of 3 checks passed
1 of 3 checks passed
ci/circleci Your tests failed on CircleCI
Details
continuous-integration/travis-ci/pr The Travis CI build failed
Details
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
@hjanuschka
Copy link

hjanuschka commented Aug 21, 2016

nice thx guys!!!

@k0nserv k0nserv deleted the k0nserv:gitlab branch Aug 21, 2016
@k0nserv k0nserv changed the title [WIP] Gitlab Gitlab Aug 22, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

8 participants
You can’t perform that action at this time.