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

Get working with Mercurial plugin (and Subversion too). #6

Merged
merged 2 commits into from
Apr 14, 2017

Conversation

kenguest
Copy link
Contributor

@kenguest kenguest commented Jun 14, 2016

Added duck typing re different methods provided by git and mercurial plugins, so that the CI Skip plugin can skip commits coming from Mercurial, dependant on content in the commit message.

The git plugin provides the commit message via getComment, and getCommitId for the id of that commit.
The Mercurial plugin provides the same information via getMsg and getNode respectively.

Compare https://github.com/jenkinsci/git-plugin/blob/master/src/main/java/hudson/plugins/git/GitChangeSet.java and https://github.com/jenkinsci/mercurial-plugin/blob/master/src/main/java/hudson/plugins/mercurial/MercurialChangeSet.java

duck typing re different methods provided by git and mercurial plugins.
@kenguest
Copy link
Contributor Author

kenguest commented Mar 30, 2017

This will also make CI Skip compatible with the subversion plugin, as looking at the code for that plugin, SubversionChangeLogSet has a getMsg() method rather than a getComment() one.

@kenguest kenguest changed the title Get working with Mercurial plugin. Get working with Mercurial plugin (and Subversion too). Mar 30, 2017
@coveralls
Copy link

Coverage Status

Coverage decreased (-4.0%) to 93.056% when pulling bac4aab on kenguest:master into 02634b4 on banyan:master.

@banyan banyan merged commit 49153fe into banyan:master Apr 14, 2017
@banyan
Copy link
Owner

banyan commented Apr 14, 2017

I'm so sorry that it takes time to merge 🙇 🙇

@kenguest
Copy link
Contributor Author

Thank you for merging my changes in anyway - all good things take time ;-)

@banyan
Copy link
Owner

banyan commented Apr 14, 2017

Dependencies are pretty old, I've tried to update it now. Just a moment...

@banyan
Copy link
Owner

banyan commented Apr 14, 2017

@kenguest

Uh-oh... Can't upload... It seems exactly same with jenkinsci/jenkins.rb#100

DEV banyan ☁  jpi release --release
Picked up _JAVA_OPTIONS: -Dfile.encoding=UTF-8
Expected string default value for '--port'; got 8080 (numeric)
/Users/banyan/.gem/jruby/2.3.1/gems/rubyzip-1.1.7/lib/zip.rb:35: warning: ObjectSpace impacts performance. See http://wiki.jruby.org/PerformanceTuning#dont-enable-objectspace
bundling...
Picked up _JAVA_OPTIONS: -Dfile.encoding=UTF-8
Fetching gem metadata from https://rubygems.org/.
Fetching version metadata from https://rubygems.org/.
Using json 2.0.4 (java)
Using slop 3.0.4
Using bundler 1.14.6
Using jenkins-plugin-runtime 0.2.3
Bundle complete! 10 Gemfile dependencies, 4 gems now installed.
Gems in the group development were not installed.
Bundled gems are installed into ./pkg/vendor/gems.
ci-skip plugin 0.1.0 built to pkg/ci-skip.hpi
deploying as a release
Generating POM
Net::HTTPServerException: 403 "Forbidden"
          error! at /Users/banyan/.rubies/jruby-9.1.8.0/lib/ruby/stdlib/net/http/response.rb:120
           value at /Users/banyan/.rubies/jruby-9.1.8.0/lib/ruby/stdlib/net/http/response.rb:129
     check_error at /Users/banyan/.gem/jruby/2.3.1/gems/jpi-0.4.1/lib/jenkins/plugin/tools/release.rb:22
             run at /Users/banyan/.gem/jruby/2.3.1/gems/jpi-0.4.1/lib/jenkins/plugin/tools/release.rb:62
         release at /Users/banyan/.gem/jruby/2.3.1/gems/jpi-0.4.1/lib/jenkins/plugin/cli.rb:55
             run at /Users/banyan/.gem/jruby/2.3.1/gems/thor-0.19.4/lib/thor/command.rb:27
  invoke_command at /Users/banyan/.gem/jruby/2.3.1/gems/thor-0.19.4/lib/thor/invocation.rb:126
        dispatch at /Users/banyan/.gem/jruby/2.3.1/gems/thor-0.19.4/lib/thor.rb:369
           start at /Users/banyan/.gem/jruby/2.3.1/gems/thor-0.19.4/lib/thor/base.rb:444
          <main> at /Users/banyan/.gem/jruby/2.3.1/gems/jpi-0.4.1/bin/jpi:6
            load at org/jruby/RubyKernel.java:979
          <main> at /Users/banyan/.gem/jruby/2.3.1/bin/jpi:22

I'll try it later as well. 🙇

@banyan
Copy link
Owner

banyan commented Apr 14, 2017

DEV banyan ☁  diff -u /Users/banyan/.gem/jruby/2.3.1/gems/jpi-0.4.1/lib/jenkins/plugin/tools/release.rb.bak /Users/banyan/.gem/jruby/2.3.1/gems/jpi-0.4.1/lib/jenkins/plugin/tools/release.rb
--- /Users/banyan/.gem/jruby/2.3.1/gems/jpi-0.4.1/lib/jenkins/plugin/tools/release.rb.bak       2017-04-14 21:12:58.000000000 +0900
+++ /Users/banyan/.gem/jruby/2.3.1/gems/jpi-0.4.1/lib/jenkins/plugin/tools/release.rb   2017-04-14 21:13:05.000000000 +0900
@@ -56,6 +56,7 @@
           version = @snapshot ? @spec.version+"-SNAPSHOT" : @spec.version
           pom = ERB.new(File.read(File.dirname(__FILE__)+"/templates/release-pom.xml.erb")).result(binding)
           path = "/#{@snapshot?'snapshots':'releases'}/org/jenkins-ci/ruby-plugins/#{@spec.name}/#{version}/#{@spec.name}-#{version}"
+          p path
           req = Net::HTTP::Put.new("#{path}.pom")
           req.body = pom
           req.basic_auth(cred.user_name,cred.password)
deploying as a release
Generating POM
"/releases/org/jenkins-ci/ruby-plugins/ci-skip/0.1.0/ci-skip-0.1.0"
Net::HTTPServerException: 403 "Forbidden"
          error! at /Users/banyan/.rubies/jruby-9.1.8.0/lib/ruby/stdlib/net/http/response.rb:120
           value at /Users/banyan/.rubies/jruby-9.1.8.0/lib/ruby/stdlib/net/http/response.rb:129

It looks path is correct, I wonder if the server permission is really changed? hmm
http://repo.jenkins-ci.org/releases/org/jenkins-ci/ruby-plugins/ci-skip/

@banyan
Copy link
Owner

banyan commented Apr 14, 2017

@kenguest

I've uploaded hpi file for now: https://github.com/banyan/jenkins-ci-skip-plugin/releases/tag/v0.1.0

image

As you may know, you can use Manage Jenkins > Advanced to upload manually.

@kenguest
Copy link
Contributor Author

I've mentioned this on Twitter just now - https://twitter.com/kenguest/status/852869281272475649 - somebody might be able to advise :-) Thanks for all your work!

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.

3 participants