Skip to content

Conversation

kax-slamcore
Copy link

@kax-slamcore kax-slamcore commented Apr 12, 2023

📚 Description

Change the filtering in is_message_needed_by_props to accept the non-virtual builder name for a build.

🤔 Motivation

The Virtual Builders pattern allows us to schedule multiple builds of the same source and builder with different properties. We use this to split the testing and packaging work over many workers.

The issue is that we would like to define a GitHubStatusPush reporter for each of these builders, however, as the virtual_builder_name of the builder is calculated at build time, we can't enumerate them during configuration.

💇 Testing

To test I've configured the following reporters in the master.cfg:

@renderer
def make_github_context(props):
    buildername = props.getProperty("virtual_builder_name", props["buildername"])
    return f"buildbot/{buildername}"

c['services'].append(reporters.GitHubStatusPush(
    token="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",
    baseURL="http://localhost:8080/mockgithub",
    verbose=True,
    context=make_github_context,
    builders=["sctest_target_position"]))

Which publishes messages like:

{   'context': 'buildbot/test:position/static_checks_2',
    'description': 'Build started.',
    'state': 'pending',
    'target_url': 'http://kax-desktop.slamcore.local:8010/#builders/105/builds/38'}
127.0.0.1 - - [12/Apr/2023 17:21:06] "POST /mockgithub/repos/slamcore/position/statuses/3dfc382d361b2609ca157ee9950a88c76427c1b6 HTTP/1.1" 200 2
{   'context': 'buildbot/test:position/static_checks_2',
    'description': 'Build done.',
    'state': 'failure',
    'target_url': 'http://kax-desktop.slamcore.local:8010/#builders/105/builds/38'}
127.0.0.1 - - [12/Apr/2023 17:21:31] "POST /mockgithub/repos/slamcore/position/statuses/3dfc382d361b2609ca157ee9950a88c76427c1b6 HTTP/1.1" 200 2

Without this change the messages were only emitted if I set

    builders=["test:position/static_checks_2'"]))

@kax-slamcore kax-slamcore marked this pull request as draft April 12, 2023 15:18
Change the filtering in `is_message_needed_by_props` to accept the
non-virtual builder name for a build.

Motivation

The [Virtual Builders
pattern](https://docs.buildbot.net/latest/manual/configuration/builders.html?highlight=virtual_builder_name#virtual-builders)
allows us to schedule multiple builds of the same source and builder
with different properties. We use this to split the testing and
packaging work over many workers.

The issue is that we would like to define a GitHubStatusPush reporter
for each of these builders, however, as the `virtual_builder_name` of the
builder is calculated at build time, we can't enumerate them during
configuration.
@kax-slamcore kax-slamcore force-pushed the QA-466-non-virtual-builder-name branch from 88f2f9c to 43ff576 Compare April 12, 2023 16:12
@kax-slamcore kax-slamcore marked this pull request as ready for review April 12, 2023 16:27
@kax-slamcore kax-slamcore merged commit e5cdaa6 into slamcore_release Apr 12, 2023
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.

2 participants