Build does not work on Jenkins 1.5xx when job build trigger requires auth #12

Closed
cliffano opened this Issue Apr 4, 2013 · 9 comments

Comments

Projects
None yet
3 participants
@cliffano
Owner

cliffano commented Apr 4, 2013

Reported by @cgiffard.

'nestor build' does not trigger the actual build on Jenkins 1.5xx .

I have verified this problem with latest Nestor master (0.1.2-pre) and Jenkins master (1.511 SNAPSHOT)

  • this affects secured jobs, it still works fine when job build trigger does not require auth
  • it's likely caused by this jenkinsci change jenkinsci/jenkins@0271fdb#L1L75
  • due to the above change, triggering a build with GET method now gives response 302
@cgiffard

This comment has been minimized.

Show comment Hide comment
@cgiffard

cgiffard Apr 4, 2013

I can verify that doing a one-two punch of a POST and then a GET provides the correct response.

cgiffard commented Apr 4, 2013

I can verify that doing a one-two punch of a POST and then a GET provides the correct response.

@cliffano

This comment has been minimized.

Show comment Hide comment
@cliffano

cliffano Apr 4, 2013

Owner

Can you confirm that the build job you're testing require authentication?

Owner

cliffano commented Apr 4, 2013

Can you confirm that the build job you're testing require authentication?

@cgiffard

This comment has been minimized.

Show comment Hide comment
@cgiffard

cgiffard Apr 4, 2013

Yeah, it does. I'll download your new build and double check.

cgiffard commented Apr 4, 2013

Yeah, it does. I'll download your new build and double check.

@cgiffard

This comment has been minimized.

Show comment Hide comment
@cgiffard

cgiffard Apr 4, 2013

New build does not trigger a new, er, build.

Also returns cached build console.

Nestor 0.1.2, Jenkins ver. 1.508.


nestor build --console TEST-dispatch2-update fails.

However, the following successfully runs the job and returns the console properly:

nestor build --console TEST-dispatch2-update param=nothing
nestor build --console TEST-dispatch2-update

cgiffard commented Apr 4, 2013

New build does not trigger a new, er, build.

Also returns cached build console.

Nestor 0.1.2, Jenkins ver. 1.508.


nestor build --console TEST-dispatch2-update fails.

However, the following successfully runs the job and returns the console properly:

nestor build --console TEST-dispatch2-update param=nothing
nestor build --console TEST-dispatch2-update
@cgiffard

This comment has been minimized.

Show comment Hide comment
@cgiffard

cgiffard Apr 4, 2013

No change in behaviour with the -p flag, unfortunately.

cgiffard commented Apr 4, 2013

No change in behaviour with the -p flag, unfortunately.

@cliffano

This comment has been minimized.

Show comment Hide comment
@cliffano

cliffano Apr 5, 2013

Owner

Please try latest master:
git clone http://github.com/cliffano/nestor && cd nestor && npm link

I've tested it with jobs that do and don't require auth and params.

  • Jenkins allows POST for all combinations
  • console has always used GET, so it shouldn't be an issue

The -p flag is used as a delay between triggering a build to start listening for console output.
By default 'nestor build -c ' waits for 5 seconds before listening to console output, but some jobs might take more than 5 secs to start writing console output, so the -p flag is added to customise the wait time, e.g. 'nestor build -c -p 10000 ' if you want to wait for 10 secs.

Please let me know how you go with it. If it works, I'll publish a new version a.s.a.p .

Owner

cliffano commented Apr 5, 2013

Please try latest master:
git clone http://github.com/cliffano/nestor && cd nestor && npm link

I've tested it with jobs that do and don't require auth and params.

  • Jenkins allows POST for all combinations
  • console has always used GET, so it shouldn't be an issue

The -p flag is used as a delay between triggering a build to start listening for console output.
By default 'nestor build -c ' waits for 5 seconds before listening to console output, but some jobs might take more than 5 secs to start writing console output, so the -p flag is added to customise the wait time, e.g. 'nestor build -c -p 10000 ' if you want to wait for 10 secs.

Please let me know how you go with it. If it works, I'll publish a new version a.s.a.p .

@cliffano

This comment has been minimized.

Show comment Hide comment
@cliffano

cliffano Apr 6, 2013

Owner

I've got confirmation from other users that the fix works for them, so I've gone ahead and published v0.1.3 .
I've also tested it with Jenkins v1.4xx and it works fine.

Owner

cliffano commented Apr 6, 2013

I've got confirmation from other users that the fix works for them, so I've gone ahead and published v0.1.3 .
I've also tested it with Jenkins v1.4xx and it works fine.

@jglick

This comment has been minimized.

Show comment Hide comment
@jglick

jglick Apr 8, 2013

Sorry for any inconvenience. Confirming that using POST unconditionally is the correct method (for this and any other REST URL that is intended to produce an action).

jglick commented Apr 8, 2013

Sorry for any inconvenience. Confirming that using POST unconditionally is the correct method (for this and any other REST URL that is intended to produce an action).

@cliffano

This comment has been minimized.

Show comment Hide comment
@cliffano

cliffano Apr 8, 2013

Owner

Thanks for the confirmation @jglick . I'll close this issue as fixed in v0.1.3 .

Owner

cliffano commented Apr 8, 2013

Thanks for the confirmation @jglick . I'll close this issue as fixed in v0.1.3 .

@cliffano cliffano closed this Apr 8, 2013

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment