takezoe / gitbucket-ci-plugin

GitBucket plug-in that adds simple CI ability to GitBucket.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

The build is not run again if I update the pull request

k33g opened this issue · comments

Hello @takezoe
I created a PR with a nodejs project and tests with mocha
if the test is ko, the build fails
I fix my test, but the PR status stays to Waiting for status to be reported and there is no build

I created a new PR with a "good" test, the build is successful, there is no more build if I update my source code (for the open PR)

@k33g I tested on my environment but couldn't reproduce. Is it occurred always? If yes, let me know detailed procedure to reproduce.

@takezoe I will try with an other laptop and write all te procedure

Hello @takezoe, here is my procedure:

I'm using:

  • gitbucket: 4.17.0
  • gitbucket-ci-plugin: 1.0.1

I created a group ACME
I created a repository demo for the ACME group

I add a file: tests/test.js

'use strict';

var expect = require('chai').expect;

describe('# 42 is 42', () => {
  it('should equal 42', () => {
    expect(42).to.equal(42);
  });
});

I add a file: package.json

{
  "name": "demo",
  "scripts": {
    "test": "./node_modules/.bin/mocha tests/**"
  },
  "author": "@k33g aka @k33g_org",
  "devDependencies": {
    "chai": "^4.1.1",
    "mocha": "^3.5.0"
  }  
}

I created a build script

npm install
npm test 

I manually run the build: it's ok

  • my default branch is master
  • master is protected
  • I checked Require status checks to pass before merging
  • I checked gitbucket-ci

I created a new branch test-1

I added a new test to tests/tests.js

describe('# 1 is 1', () => {
  it('should equal 1', () => {
    expect(1).to.equal(0);
  });
});

I created a new PR from test-1

1

I refreshed the page, the test failed, it's normal

2

I fixed my test

describe('# 1 is 1', () => {
  it('should equal 1', () => {
    expect(1).to.equal(1);
  });
});

I returned to the PR

the status is blocked on pending check

3

@k33g Thanks for detailed procedure! I'll try again.

@k33g I suppose maybe git user who pushed the second commit does not exist on GitBucket. Build is kicked by commit hook, and to kick commit hooks, it requires that pusher is registered as same username in current implementation.

I'd like to fix this behavior in the future version of GitBucket, but could you test again after changing your git username to same as GitBucket username to confirm my hypothesis?

@takezoe for the tests, I don't use git, I directly update the code with the GitBucket UI (I know it's bad, but so easy)

@k33g Oh, I see. It needs more investigation.

@k33g I got it! Code editing in the browser doesn't kick the build because commit hooks are not applied to the online editing in GitBucket 4.17.0. This problem is going to be fixed in 4.18.0.

And don't mind what I mentioned above. It was my misunderstanding. 🙇

I suppose maybe git user who pushed the second commit does not exist on GitBucket. Build is kicked by commit hook, and to kick commit hooks, it requires that pusher is registered as same username in current implementation.

@takezoe Thank you for the answer 👍
btw I'm very happy to see you at scala.io

@k33g Me too! but we aren't good at English so we are working hard to prepare the presentation just now. 😢
Anyway, GitBucket 4.18.0 and gitbucket-ci-plugin 1.1.0 has been released. Could you try again with them?
https://gitbucket.github.io/gitbucket-news/gitbucket/2017/10/14/gitbucket-4.18.0.html

@takezoe don't be afraid about 🇬🇧 mine is very creepy, you can ask https://github.com/ikeike443 😉
🇫🇷 people don't speak 🇬🇧 very well so it's not a problem

I will test the new release 😄

@takezoe it works 👏
I will play more with it this week end 😄
build

@k33g That's good. So is it possible to close this issue?

and thanks for your encouragement. I know ikeda-san who is now GitHubber. He was Scala programmer and Play1 committer in the past. I'm sad a little because he hasn't been writing Scala for a long time. 😭