WIP: Verify BC breakages on pull requests, by comparing PR against base branch#126
WIP: Verify BC breakages on pull requests, by comparing PR against base branch#126Ocramius wants to merge 1 commit intolaminas:1.19.xfrom
Conversation
Ocramius
commented
Sep 3, 2022
| Q | A |
|---|---|
| Documentation | no |
| Bugfix | no |
| BC Break | no |
| New Feature | yes |
| RFC | no |
| QA | yes |
| }, | ||
| ] as Tool[]; | ||
|
|
||
| if (bcTool !== null) { |
There was a problem hiding this comment.
yuck yuck yuck - would prefer to merge two sets of Tool[], but for now, this will have to do.
There was a problem hiding this comment.
You could do something like:
const tools = [
...[bcTool].filter()
<other tools>
];Spread new array containing the `bcTool with filter removing null values.
There was a problem hiding this comment.
Tried that, but .filter() TSC wasn't able to infer Tool[] from it, due to too many dynamic expressions, I guess.
There was a problem hiding this comment.
...([bcTool].filter() as Tool[]) will do that.
tests/code-check-roave-backward-compatibility-check-on-pr/GITHUB_EVENT_CONTENTS.json
Show resolved
Hide resolved
| }, | ||
| ] as Tool[]; | ||
|
|
||
| if (bcTool !== null) { |
There was a problem hiding this comment.
You could do something like:
const tools = [
...[bcTool].filter()
<other tools>
];Spread new array containing the `bcTool with filter removing null values.
There was a problem hiding this comment.
Change looks fine for me.
-
Passing
git fetch <basebranch>tobefore_scriptshould work.
I'd say lets add it from the tool. I would prefer keeping thesebefore_scriptandafter_scriptthings in internal scope for now. No need to open that up for every check. -
Can we probably remove the empty
test.envfiles? I do not see a good reason why we should have a bunch of dead files around when they do not make a difference. -
I would prefer to pass the
targetRefvia theappConfigwhere the supported PHP versions of the project are stored, where the information if a lock file is available is stored, etc. This would probably reduce the LoC which have to change to a minimum and we do not need to pass the action through half of the application scope.
| ): [JobForMatrix, ...JobForMatrix[]] { | ||
| const config = parseJsonFile(this.continousIntegrationConfigurationJsonFileName, true) as ConfigurationFromFile; | ||
| const tools = createTools(appConfig); | ||
| const tools = createTools(appConfig, this.action); |
There was a problem hiding this comment.
Can we pass the hash in the appConfig instead?
It also holds if there is a lockfile so we do not have to check for fileExists(lockFile) in every tool.
I would prefer having a dedicated object/property in the app config for the target branch REF as well.
tests/code-check-roave-backward-compatibility-check-on-pr/GITHUB_EVENT_CONTENTS.json
Show resolved
Hide resolved
|
Don't we get the target branch ref from environment?
Do we really need that whole event parsing here or should we just grab the ref from environment instead?
|
3e17f68 to
337379f
Compare
|
I can't seem to be able to allocate a chunk of time to this. It would save me a massive amount of time in code reviews, but debugging the last details (around fetching multiple refs) is not something I'll be able to do soon. |
|
I'll see if I find some time and apply a few things. I would prefer to avoid the whole event stuff and instead use We could also release a version where we can opt-in to the new job before rolling out for everyone by-default. i.e. a In one of the following releases we can then change the default of the WDYT? |
|
@Ocramius I am unable to push to your fork and thus, can't push my changes. |
|
Superseded by #226 |
I generally don't do this due to repo secrets :-) Anyway, thanks for taking over on this! |