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

buildStarted method doesn't receive any useful information in buildbot 0.9 #3420

Closed
aj062 opened this issue Jul 6, 2017 · 5 comments
Closed

Comments

@aj062
Copy link
Contributor

aj062 commented Jul 6, 2017

When someone subscribe to methods like buildStarted, buildFinished through base.StatusReceiverMultiService, they receive a BuildStatus object containing information about the Build.

In buildbot 0.8, it used to contain a lot of useful information about the build including build properties, build number etc.

In buildbot 0.9, BuildStatus object which is received doesn't have properties at all (removed in https://git.io/vQr0e). Also, the build number seems to be always zero (probably because of https://git.io/vQr0n). The BuildStatus doesn't even have buildid.

I am receiving following data in buildStarted through BuildStatus object:

build_status.asDict(): 
'{'logs': [], 'builderName': u'My Debug TryBot', 'text': [], 'sourceStamps': [], 'results': None, 'number': 0, 'currentStep': None, 'times': (1499357455.647606, None), 'blame': [], 'reason': None, 'eta': None, 'steps': [], 'worker': '???'}'

Above data doesn't seems to have any information to identify the build. It just tells me that some build started. In buildbot 0.9 it used to have so much useful info.

It seems like BuildStatus class is getting deprecated (as per comment in https://git.io/vQr0e). We should pass object of build class instead of build_status to watcher in buildStarted.

buildStarted method will be useful if it has complete build information (like buildbot 0.8).

@aj062
Copy link
Contributor Author

aj062 commented Jul 6, 2017

Looking at https://git.io/vQrzZ , it receives Build object, but doesn’t use it at all. Instead of passing self, it should pass 'build' at https://git.io/vQrzR. And then, assert in https://git.io/vQrzS should be updated from s.builder to s.build_status.builder

@tardyp
Copy link
Member

tardyp commented Jul 6, 2017

statusAPI is not supported in buildbot nine, so StatusReceiverMultiService will never work.
You should use the reporter API.
There are still some reliques in the code that shall be cleaned

@aj062
Copy link
Contributor Author

aj062 commented Jul 7, 2017

Is there a reporter API having the same (or better) functionality provided by StatusReceiverMultiService?

We have watchers which currently subscribe to buildStarted, buildFinished events using StatusReceiverMultiService and do various custom operations based on build properties.

@tardyp
Copy link
Member

tardyp commented Jul 9, 2017

The reporter api expects a reporter to register to events, then to call the data api to get the exact info it needs. The best for doing that is to look at existing reporters. You can look at HttpStatusBase, which is pretty simple, and maybe already suit your needs as a base class for what you want to achieve.
I could provide more info if I knew exactly what is the purpose of your reporter.

@aj062
Copy link
Contributor Author

aj062 commented Jul 14, 2017

Thanks. It worked.

Also, I filed #3441

@tardyp tardyp closed this as completed Jul 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

2 participants