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

Unable to pull logs while build still in progress #217

Closed
wtrocki opened this issue Dec 13, 2016 · 8 comments
Closed

Unable to pull logs while build still in progress #217

wtrocki opened this issue Dec 13, 2016 · 8 comments

Comments

@wtrocki
Copy link
Contributor

wtrocki commented Dec 13, 2016

What's the preferred way to fetch logs periodically from jenkins?
Most of the clients using response headers to determine if log is complete.

Example here:
https://github.com/silas/node-jenkins/blob/master/lib/build.js#L190

Thanks to that approach logs can be fetched partially. Jenkins also offers another API to retrieve logs using offset.

Java client using simplified endpoint:

return client.get(getUrl() + "/logText/progressiveText");

I would be happy to contribute and build more sophisticated way to retrieve logs, but I just want to know general target for this client, before doing it.

@matzew
Copy link

matzew commented Dec 13, 2016

👍

@khmarbaise
Copy link
Member

It would be great to offer more ways to fetch logs or better if those can be fetched partially for the users of the API..If you like to contribute that would be great idea...

@wtrocki
Copy link
Contributor Author

wtrocki commented Dec 13, 2016

Awesome. I think we can do this in many ways.
Some propositions bellow.

Fetching logs asynchronously.

BuildWithDetails build=...
build.poolLogs(new LogUpdateListener(){
  function String onData(){...}
  function String onFinish(){..}
}

Fetching logs with markers and additional metadata.

BuildWithDetails build=...
LogDetails details = build.fetchLogs(...)
details.finished()
details.delta(); // delivers delta

Fetching with specifying limit

BuildWithDetails build=...
LogDetails details = build.fetchLogs(0,1000) //  start and offset

What would be preferred approach?

@khmarbaise
Copy link
Member

To be honest I have no preferred approach. Start with that one you like most...may be you can offer multiple ways ;-) ?

@wtrocki wtrocki changed the title [Question] Unable to pull logs while build still in progress Unable to pull logs while build still in progress Dec 19, 2016
@chimisu
Copy link

chimisu commented Dec 15, 2017

build.details().getConsoleOutputText()?

@wtrocki
Copy link
Contributor Author

wtrocki commented Dec 15, 2017

@doterme As far I remember this is for finished builds when you do not need to deal with the partial console log.

@chimisu
Copy link

chimisu commented Dec 15, 2017

@wtrocki ,you should get a build number at first,then get the console log in a timer,this is not for finished,it is in real time

@wtrocki
Copy link
Contributor Author

wtrocki commented Dec 15, 2017

@doterme - Sorry for confusion. In fact I implemented getConsoleOutputText method to resolve this issue. Obviously this ticket is resolved so I'm going to close it. See referenced PR for more details.

@wtrocki wtrocki closed this as completed Dec 15, 2017
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

4 participants