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

Add Build.skipBuildIf #8288

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Add Build.skipBuildIf #8288

wants to merge 1 commit into from

Conversation

MagicRB
Copy link
Contributor

@MagicRB MagicRB commented Jan 10, 2025

Contributor Checklist:

  • I have updated the unit tests
  • I have created a file in the newsfragments directory (and read the README.txt in that directory)
  • I have updated the appropriate documentation

@MagicRB MagicRB force-pushed the skip-builds branch 2 times, most recently from b4410da to e5c578f Compare January 10, 2025 14:08
@Mic92
Copy link
Contributor

Mic92 commented Jan 11, 2025

Related to this one: #8285

@MagicRB MagicRB force-pushed the skip-builds branch 5 times, most recently from f2784a4 to e50492d Compare January 15, 2025 14:54
Signed-off-by: magic_rb <richard@brezak.sk>
@p12tic
Copy link
Member

p12tic commented Jan 24, 2025

Looks like my previous review failed to identify a number of issues and possible improvements. Sorry about that. I was focused into the changes to Build side, not how it's configured.

My further comments:

  • Please use snake_case for new code.

  • Steps have doStepIf. I think our property could be named do_build_if to keep consistency.

  • BuildFactories currently behave essentially as a list of build steps now. The configuration lives in a BuilderConfig. I think it makes sense to move do_build_if there as well. The the line self.skipBuild = self.skipBuildIf(self) would become self.do_build = self.builder.config.do_build_if(self) or similar.

  • There won't be need for setSkipBuildIf anymore? A static configuration will be enough, won't it?

  • Integration test is missing. Easiest would be to add one to master/buildbot/test/integration/test_custom_buildstep.py. Add builder_kwargs argument to create_config_for_step and maybe use this test as a base for your test:

    @defer.inlineCallbacks
    def test_step_raising_buildstepfailed_in_start(self):
        builder_id = yield self.create_config_for_step(FailingCustomStep())

        yield self.do_test_build(builder_id)
        yield self.assertBuildResults(1, results.FAILURE)

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.

3 participants