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

Update docker environment and CONTRIBUTING.md instructions #57

Merged
merged 1 commit into from
Nov 11, 2021

Conversation

ajgarlag
Copy link
Contributor

@ajgarlag ajgarlag commented Oct 20, 2021

Alternative to #56 updating current docker environment.

Fix #55

@chalasr
Copy link
Member

chalasr commented Nov 1, 2021

@ajgarlag I'm divided. I would drop the docker setup, but since you updated it here I guess we can keep it if some find it useful. What's your preference?

@ajgarlag
Copy link
Contributor Author

ajgarlag commented Nov 2, 2021

@chalasr I've decided to submit two pull requests so you can evaluate the pros and cons of each.

When I contributed the authorization_code grant to trikoder/oauth2-bundle, the docker environment was a great help mainly because the timecop extension was used for time-sensitive tests. Without the docker environment, maybe I would not have contributed the PR. But it has a main drawback: it requires docker as a development dependency (I know several PHP developers that are not comfortable with this tool).

In this project, I've not needed docker at all, and the contributing workflow was similar to other PHP projects. But @X-Coder264 already commented the advantages of keeping it.

The main problem I see with keeping the docker environment is that is not being used in GitHub actions. I think that if we keep the docker environment as the official workflow for contributing to the bundle, we should update GitHub actions to make use of it so we can ensure that the docker environment is working as expected.

@chalasr
Copy link
Member

chalasr commented Nov 2, 2021

Oh, I missed Antonio's comment on your issue sorry. Let's keep it.

The main problem I see with keeping the docker environment is that is not being used in GitHub actions. I think that if we keep the docker environment as the official workflow for contributing to the bundle, we should update GitHub actions to make use of it so we can ensure that the docker environment is working as expected.

Agree 👍

@ajgarlag ajgarlag force-pushed the update-docker branch 2 times, most recently from 83804ee to 7fc7ca6 Compare November 2, 2021 11:33
@ajgarlag
Copy link
Contributor Author

ajgarlag commented Nov 2, 2021

I've added two GitHub actions to check CS and execute tests using the docker environment.

Does the same statement from Antonio Pauletich's (I'm Antonio too) comment about not having PHP-CS-Fixer as part of the dev dependencies applies to Psalm? Should we move Psalm from composer.json to docker environment?

@chalasr
Copy link
Member

chalasr commented Nov 2, 2021

(I'm Antonio too)

Haha right, let's use gh usernames then.

Should we move Psalm from composer.json to docker environment?

That makes sense to me.

@ajgarlag
Copy link
Contributor Author

ajgarlag commented Nov 2, 2021

Ok, one last question. I think we can execute checking coding standards, running static analysis, and running unit tests sequentially in one GitHub action to avoid building the docker environment three times. WDYT?

@chalasr
Copy link
Member

chalasr commented Nov 2, 2021

I like the fact they represent distinct checks on a PR so better keep duplicating (or reuse steps somehow?) IMO

@ajgarlag
Copy link
Contributor Author

ajgarlag commented Nov 2, 2021

In that case, IMO the PR is ready for me. If it's OK for you, I'll squash the commits.

@ajgarlag ajgarlag force-pushed the update-docker branch 2 times, most recently from bdddf73 to 7bb2ba9 Compare November 2, 2021 12:38
@chalasr
Copy link
Member

chalasr commented Nov 2, 2021

@ajgarlag The added docker-* workflows can replace the existing (non docker) ones isn't it?
I don't think it's relevant to have the same job runs with and without docker. Let's just run everything on docker?

@ajgarlag
Copy link
Contributor Author

ajgarlag commented Nov 2, 2021

@ajgarlag The added docker-* workflows can replace the existing (non docker) ones isn't it? I don't think it's relevant to have the same job runs with and without docker. Let's just run everything on docker?

Yes, but in that case, the code will be tested only with the versions defined in Dockerfile. So my previous proposition was to keep current GitHub actions that will test the code with the latest version of each tool, and to add a new docker.yml file to run checking coding standards, running static analysis, and running unit tests sequentially just to ensure that the docker environment is working. If this action fails, but the other one passes, then the Dockerfile should be updated.

@X-Coder264
Copy link
Contributor

@ajgarlag The Dockerfile could be changed so that it fetches the latest versions of Composer/Flex/Xdebug/PHP CS fixer by default and then the same Docker file could be used to test across all supported PHP versions.

@ajgarlag
Copy link
Contributor Author

ajgarlag commented Nov 2, 2021

@X-Coder264 Thanks, I'll try to update de Dockerfile.

@ajgarlag ajgarlag force-pushed the update-docker branch 7 times, most recently from e478119 to d5e8782 Compare November 3, 2021 11:51
@ajgarlag
Copy link
Contributor Author

ajgarlag commented Nov 3, 2021

I've updated the Dockerfile to install always the latest version of development tools. The only build argument for the docker image is the PHP version.

WDYT?

@chalasr
Copy link
Member

chalasr commented Nov 6, 2021

@ajgarlag Looks great. One thing, can we reduce the number of checks?
The coverage before this PR was good enough to me, it's ok not to test with low/high deps for all symfony/php versions.

@ajgarlag ajgarlag force-pushed the update-docker branch 2 times, most recently from aa220e8 to 1e9e37a Compare November 11, 2021 10:56
@ajgarlag ajgarlag force-pushed the update-docker branch 5 times, most recently from 72496c9 to 0ef9d1c Compare November 11, 2021 11:42
@ajgarlag
Copy link
Contributor Author

@chalasr After some vacation days, I've rebased and finished my work here. WDYT?

Copy link
Member

@chalasr chalasr left a comment

Choose a reason for hiding this comment

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

Awesome!

Use the docker environment in GitHub Actions too
@ajgarlag
Copy link
Contributor Author

I've changed the 8.1-rc docker tag so the latest available version is used always

@ajgarlag ajgarlag mentioned this pull request Nov 11, 2021
@chalasr
Copy link
Member

chalasr commented Nov 11, 2021

Thank you @ajgarlag.

@chalasr chalasr merged commit 4e39513 into thephpleague:master Nov 11, 2021
@ajgarlag ajgarlag deleted the update-docker branch November 12, 2021 08:59
@ajgarlag
Copy link
Contributor Author

@chalasr Off-topic: While coding this PR, I got a failed test that I cannot explain. See https://github.com/thephpleague/oauth2-server-bundle/runs/4177437425?check_suite_focus=true. Maybe a time sensitive assertion?

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.

CONTRIBUTING.md documentation is outdated
3 participants