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

Build properties #1380

Merged
merged 2 commits into from Nov 27, 2014
Merged

Build properties #1380

merged 2 commits into from Nov 27, 2014

Conversation

benallard
Copy link
Contributor

Here it is !

The underlying wiring is done: process -> data -> db.

I don't have data endpoint yet, it should make the subject of another PR I believe, That one is already big enough ...

@sa2ajj
Copy link
Contributor

sa2ajj commented Nov 23, 2014

If it's big, where are the release notes? :)

from twisted.internet import reactor


class BProps(dict):
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the purpose of this class?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

explicit casting. The concept is stolen from other properties table.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure about it. dict(properties) is clearer to me.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed, less lines, less bugs, more coverage ;)

@benallard
Copy link
Contributor Author

Re release-notes: It's not a change as we aim at providing the same functionality as for eight ... Not sure where to document that.

@sa2ajj
Copy link
Contributor

sa2ajj commented Nov 23, 2014

But now the properties are stored in the database, right? So it's worth mentioning.

@benallard
Copy link
Contributor Author

New round ...

@sa2ajj
Copy link
Contributor

sa2ajj commented Nov 23, 2014

👍

@@ -403,9 +403,22 @@ def startNextStep(self):
self.executedSteps.append(s)
self.currentStep = s
d = defer.maybeDeferred(s.startStep, self.conn)
d.addCallback(self._flushProperties)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Anyway we could switch this method to an inlineCallback construction, and paralellize both _flushProperties and _stepDone ? Hint: the Errback makes it less trivial.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You should flushProperties in case of error too. So this would be addBoth.

I dont think there is a need for unnecessary optimization.

@benallard
Copy link
Contributor Author

Travis happy, let's wait for more pair of eyes, shall we ?

@sa2ajj
Copy link
Contributor

sa2ajj commented Nov 23, 2014

Yes, I think it's a good idea.

@benallard
Copy link
Contributor Author

What a surprise ! The /builds/:n/properties endpoint exists, and is working ! I had absolutely not expected that !

@@ -116,6 +147,44 @@ def thd(conn):
results=results)
return self.db.pool.do(thd)

@base.cached("BuildProperties")
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we use a cache at all there ? Are we at risk of caching temporary values for a property, and returning the wrong (temporary) value to a subsequent call ?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I really do not know. Maybe @tardyp could say something about this?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yes, we should not cache anything unless the build is finished.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should I introduce a base.cacheIf/Unless ?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For now, I would expect we use cache only for immutable. We will see with experience how we can enhance the caching behavior

return BProps(l)
return self.db.pool.do(thd)

def setBuildProperty(self, bid, name, value, source):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shall we have a id key which is hash(buildid, name) ? so that we can update the property directly?

http://dev.mysql.com/doc/refman/5.6/en/insert-on-duplicate.html

@tardyp
Copy link
Member

tardyp commented Nov 23, 2014

I think we should first merge the db part of this (model, migration, dbapi), which is most of the PR, and mostly okay

@benallard
Copy link
Contributor Author

I could do that, that would make the full story easier indeed.

On 23 Nov 2014, at 22:34, Pierre Tardy notifications@github.com wrote:

I think we should first merge the db part of this (model, migration, dbapi), which is most of the PR, and mostly okay


Reply to this email directly or view it on GitHub.

@benallard benallard mentioned this pull request Nov 24, 2014
@benallard
Copy link
Contributor Author

See #1384 for the DB part of this PR. Hopefully it gets easier to review that way ...

@benallard benallard mentioned this pull request Nov 25, 2014
@benallard
Copy link
Contributor Author

Just pushed the last part of this sequence here.

@tardyp
Copy link
Member

tardyp commented Nov 27, 2014

I still have concern in the fact that this solution is unefficient, but it works, so lets merge it, and optimize it if the benchmarks shows it is needed.

sa2ajj pushed a commit that referenced this pull request Nov 27, 2014
@sa2ajj sa2ajj merged commit a9fcf31 into buildbot:master Nov 27, 2014
@benallard benallard deleted the build_properties branch December 3, 2014 20:12
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

Successfully merging this pull request may close these issues.

None yet

4 participants