Skip to content

Comments

WIP: Verify BC breakages on pull requests, by comparing PR against base branch#126

Closed
Ocramius wants to merge 1 commit intolaminas:1.19.xfrom
Ocramius:feature/roave-bc-checker
Closed

WIP: Verify BC breakages on pull requests, by comparing PR against base branch#126
Ocramius wants to merge 1 commit intolaminas:1.19.xfrom
Ocramius:feature/roave-bc-checker

Conversation

@Ocramius
Copy link
Member

@Ocramius Ocramius commented Sep 3, 2022

Q A
Documentation no
Bugfix no
BC Break no
New Feature yes
RFC no
QA yes

@Ocramius Ocramius added this to the 1.16.0 milestone Sep 3, 2022
},
] as Tool[];

if (bcTool !== null) {
Copy link
Member Author

Choose a reason for hiding this comment

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

yuck yuck yuck - would prefer to merge two sets of Tool[], but for now, this will have to do.

Copy link
Member

Choose a reason for hiding this comment

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

You could do something like:

const tools = [
    ...[bcTool].filter()
    <other tools>
];

Spread new array containing the `bcTool with filter removing null values.

Copy link
Member Author

Choose a reason for hiding this comment

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

Tried that, but .filter() TSC wasn't able to infer Tool[] from it, due to too many dynamic expressions, I guess.

Copy link
Member

Choose a reason for hiding this comment

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

...([bcTool].filter() as Tool[]) will do that.

},
] as Tool[];

if (bcTool !== null) {
Copy link
Member

Choose a reason for hiding this comment

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

You could do something like:

const tools = [
    ...[bcTool].filter()
    <other tools>
];

Spread new array containing the `bcTool with filter removing null values.

Copy link
Member

@boesing boesing left a comment

Choose a reason for hiding this comment

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

Change looks fine for me.

  • Passing git fetch <basebranch> to before_script should work.
    I'd say lets add it from the tool. I would prefer keeping these before_script and after_script things in internal scope for now. No need to open that up for every check.

  • Can we probably remove the empty test.env files? 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 targetRef via the appConfig where 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);
Copy link
Member

Choose a reason for hiding this comment

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

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.

@Ocramius Ocramius modified the milestones: 1.16.0, 1.17.0 Sep 5, 2022
@Ocramius Ocramius changed the base branch from 1.16.x to 1.17.x September 5, 2022 13:03
@Ocramius Ocramius modified the milestones: 1.17.0, 1.18.0 Sep 5, 2022
@Ocramius Ocramius changed the base branch from 1.17.x to 1.18.x September 5, 2022 14:11
@Ocramius Ocramius self-assigned this Sep 22, 2022
@Ocramius Ocramius removed this from the 1.18.0 milestone Sep 22, 2022
@boesing
Copy link
Member

boesing commented Sep 25, 2022

Don't we get the target branch ref from environment?
https://docs.github.com/en/actions/learn-github-actions/environment-variables#default-environment-variables

  • GITHUB_BASE_REF

Do we really need that whole event parsing here or should we just grab the ref from environment instead?

const GITHUB_BASE_REF = process.env["GITHUB_BASE_REF"] || "" should already do the job, not?

@Ocramius Ocramius force-pushed the feature/roave-bc-checker branch from 3e17f68 to 337379f Compare October 12, 2022 08:23
@Ocramius Ocramius changed the base branch from 1.18.x to 1.19.x October 12, 2022 15:10
@Ocramius
Copy link
Member Author

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.

@boesing
Copy link
Member

boesing commented Oct 13, 2022

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 GITHUB_BASE_REF. This would tighten down the amount of changes here to a minimum and then we can start with an initial PoC.

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 .laminas-ci.json flag (which can also be used to fully disable the check in case some1 wants to). This will provide us the possibility to have it field tested in some projects for quite a while. Especially the whole "multiple ref" stuff (which I probably did not fully understand right now) could be verified.

In one of the following releases we can then change the default of the .laminas-ci.json flag to true and rollout the feature for everyone by default.

WDYT?

@boesing
Copy link
Member

boesing commented Jul 8, 2023

@Ocramius I am unable to push to your fork and thus, can't push my changes.
Could you enable maintainer edits or does the fork has limited access?

@boesing
Copy link
Member

boesing commented Jul 9, 2023

Superseded by #226

@boesing boesing closed this Jul 9, 2023
@Ocramius
Copy link
Member Author

Could you enable maintainer edits or does the fork has limited access?

I generally don't do this due to repo secrets :-)

Anyway, thanks for taking over on this!

@Ocramius Ocramius deleted the feature/roave-bc-checker branch July 10, 2023 08:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants