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

Allow sending stryker-mutator.io reports for multiple branches #1536

Closed
Ocramius opened this issue Jul 14, 2021 · 1 comment · Fixed by #1538
Closed

Allow sending stryker-mutator.io reports for multiple branches #1536

Ocramius opened this issue Jul 14, 2021 · 1 comment · Fixed by #1538
Labels
DX Developer Experience Feature Request
Milestone

Comments

@Ocramius
Copy link
Sponsor Contributor

Since approximately 2019, I started moving away from the master branch naming, and started to use the minor version of libraries as branch name, such as:

  • 1.0.x
  • 2.1.x
  • ...

Infection has a configuration for sending information to stryker-mutator.io, but only when the branch name matches precisely:

if ($buildContext->branch() !== $this->branch) {

Would a patch to change this into a regex (perhaps new setting, if necessary?) be welcome?

@maks-rafalko maks-rafalko added DX Developer Experience Feature Request labels Jul 14, 2021
@maks-rafalko
Copy link
Member

maks-rafalko commented Jul 14, 2021

Would a patch to change this into a regex (perhaps new setting, if necessary?) be welcome?

Absolutely!

related to

Ocramius added a commit to Ocramius/infection that referenced this issue Jul 14, 2021
…n reporting

By configuring `logs.badge.matchBranchRegex`, it is possible to set multiple branches to report
their mutation score to upstream tools:

```json
{
    "source": {
        "directories": ["src/"]
    },
    "logs": {
        "badge": {
            "matchBranchRegex": "/^release-.*$/"
        }
    }
}
```

Note that `logs.badge.matchBranchRegex` is mutually exclusive with `logs.badge.branch`, which
is much more restrictive: the two cannot be used together.

Fixes infection#1536
Ocramius added a commit to Ocramius/infection that referenced this issue Jul 20, 2021
By configuring `logs.badge.branch` with a `/`-delimited regular expression, we can collect
reports about a number of branches.

```json
{
    "source": {
        "directories": ["src/"]
    },
    "logs": {
        "badge": {
            "branch": "/^release-.*$/"
        }
    }
}
```

Note that `logs.badge.matchBranchRegex`, initially proposed as an alternative, has also been removed.

We can safely assume that a `branch` value starting and ending with `/` is a regular expression, because
git branches starting or ending with `/` are not valid anyway.

Fixes infection#1536
Ocramius added a commit to Ocramius/infection that referenced this issue Jul 21, 2021
…n reporting

By configuring `logs.badge.matchBranchRegex`, it is possible to set multiple branches to report
their mutation score to upstream tools:

```json
{
    "source": {
        "directories": ["src/"]
    },
    "logs": {
        "badge": {
            "matchBranchRegex": "/^release-.*$/"
        }
    }
}
```

Note that `logs.badge.matchBranchRegex` is mutually exclusive with `logs.badge.branch`, which
is much more restrictive: the two cannot be used together.

Fixes infection#1536
Ocramius added a commit to Ocramius/infection that referenced this issue Jul 21, 2021
By configuring `logs.badge.branch` with a `/`-delimited regular expression, we can collect
reports about a number of branches.

```json
{
    "source": {
        "directories": ["src/"]
    },
    "logs": {
        "badge": {
            "branch": "/^release-.*$/"
        }
    }
}
```

Note that `logs.badge.matchBranchRegex`, initially proposed as an alternative, has also been removed.

We can safely assume that a `branch` value starting and ending with `/` is a regular expression, because
git branches starting or ending with `/` are not valid anyway.

Fixes infection#1536
theofidry pushed a commit that referenced this issue Jul 21, 2021
@maks-rafalko maks-rafalko added this to the 0.24.0 milestone Jul 21, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
DX Developer Experience Feature Request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants