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

When withScmChangesOnly flag is not set doesn't update repo #13

Closed
tailhook opened this issue Jun 15, 2016 · 8 comments
Closed

When withScmChangesOnly flag is not set doesn't update repo #13

tailhook opened this issue Jun 15, 2016 · 8 comments

Comments

@tailhook
Copy link

I think this flag should only skip build if there are no changes. But it looks like if the withScmChangesOnly is false, nci doesn't even update the repo to find out whether the latter has any changes.

In particular, I have a problem with git webhook, where I can't set withScmChangesOnly flag at all (it's always false). So it always rebuilds old version when webhook is triggered (builds from scheduler are okay, though)

@okv
Copy link
Member

okv commented Jun 16, 2016

withScmChangesOnly flag doesn't prevent pulling from repository.
nci tries to get new changes and then skip build if only withScmChangesOnly is true and no scm changes.

There should another reason e.g. maybe it's wrong hook and when nci checks for changes they are absent.

@tailhook
Copy link
Author

Well, I assumed this from this line of code

Also nci-base-webhook just does builds.create, and I clearly see that builds triggered by user do git pull and builds triggered by scheduler too. But not builds from webhook.

Any other pointers? Should I close this one and open an issue in nci-base-webhook?

@fleg
Copy link
Member

fleg commented Jun 16, 2016

Scheduler also does only builds.create

I just checked github-webhook:
image
git pull works fine

@tailhook
Copy link
Author

Okay, here are three builds:

  1. This one is initiated from webhook and is wrong: http://mglawica.org:7000/builds/38 The message package verwalter-render-0.3.4-3-g94dfaba-amd64 is already in repository means we have already built it (you can see the whole log at the link). The version is got from git describe in the build
  2. This one is a subsequent from the scheduler: http://mglawica.org:7000/builds/39 which builds an new version and shows the changelog
  3. This one has been done yesterday, so you can see that it has a revision 94dfaba from error message in build 38 linked above: http://mglawica.org:7000/builds/37

In github logs I see hook with code 200 that initiated the build, webhook request content follows. Headers:

Request URL: http://mglawica.org:7000/webhooks/verwalter/github/xxxx
Request method: POST
content-type: application/json
Expect: 
User-Agent: GitHub-Hookshot/0b0c52f
X-GitHub-Delivery: 34db4680-33bd-11e6-95f2-f0a6c5e21353
X-GitHub-Event: push

Body (partial, note revisions):

{
  "ref": "refs/heads/master",
  "before": "94dfabaf8baf45ad9490dea68c5c403b233b4980",
  "after": "2b8c9557e444ea6dc98b670f1086b9524d93f4cf",
...

The only issue I see at github log is the following "push" event with a tag, which returns error code 406. I assume that it's fine.

@tailhook
Copy link
Author

Well, there is a git pull in the log, so I'm not sure what the issue here. Maybe it tries to pull too fast? I.e. we need to sleep a little? :) Any ideas how to debug the issue?

@okv
Copy link
Member

okv commented Apr 12, 2017

@tailhook could you check that with latest nci (1.0.9 currently)?
Some things changed, especially the way nci implements work with git scm.

@tailhook
Copy link
Author

Yes, it works now. Not sure since what version, but I'm closing it anyway.

@okv
Copy link
Member

okv commented Apr 21, 2017 via email

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

No branches or pull requests

3 participants