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

GH action to respect working-directory #591

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Conversation

akaihola
Copy link
Owner

@akaihola akaihola commented Jul 27, 2024

🟠 Pending review is delaying Darker 3.0.0 release.


This patch introduces the following changes to the Darker GitHub Action:

  • new working-directory input option (defined in action.yml)
  • new exitcode and stdout outputs, and Python helpers for setting them
  • use the commit-range action straight from the current Darker Git checkout
  • install pip-requirements-parser in a separate action step instead of the entrypoint script
  • cache the Python environment
  • exit with code 21 if specified working-directory doesn't exist
  • refactor pip install into a helper function
  • only create virtualenv if it doesn't already exist
  • correct GitHub URL when version starts with @ (pointing to a branch or tag)
  • run Darker in the specified working-directory
  • return Darker terminal output in the stdout output
  • check exit code and output in the working-directory test workflow
  • update action tests to match new behavior

FIxes #587

Goes into Darker 3.0.0 since exit codes will need to change in a backwards incompatible way.

@akaihola akaihola added the bug Something isn't working label Jul 27, 2024
@akaihola akaihola self-assigned this Jul 27, 2024
@akaihola akaihola force-pushed the gh-action-working-directory branch from f78011c to 9626dd8 Compare July 27, 2024 20:52
@akaihola akaihola requested a review from dshemetov July 28, 2024 20:33
@akaihola akaihola force-pushed the gh-action-working-directory branch 13 times, most recently from f2d8c1d to 7003e2a Compare July 29, 2024 22:08
@akaihola akaihola force-pushed the gh-action-working-directory branch 4 times, most recently from 3278010 to 12e99aa Compare July 31, 2024 20:16
@akaihola
Copy link
Owner Author

akaihola commented Jul 31, 2024

@dshemetov this one is finally ready for review and validation! The working-directory: input option should now work in the GitHub action.

@akaihola akaihola force-pushed the gh-action-working-directory branch 2 times, most recently from 630ae4e to 2b486a6 Compare August 1, 2024 14:59
@akaihola akaihola requested a review from Svenito August 1, 2024 15:00
@akaihola akaihola force-pushed the gh-action-working-directory branch from 2b486a6 to bf1d6af Compare August 9, 2024 05:58
@akaihola akaihola requested a review from dwt August 27, 2024 15:56
@akaihola akaihola force-pushed the gh-action-working-directory branch 3 times, most recently from 2e1cd5d to dcd00c5 Compare August 27, 2024 20:53
@akaihola
Copy link
Owner Author

I'm still hoping for extra eyeballs for this one. Sorry for adding quite a bit of mechanics necessary for testing this feature. Let me know if more comments or supporting documentation is required.

This may be easier to review commit by commit than the whole diff at once.

Ping @dshemetov @Svenito @dwt @MatthijsBurgh whichever one of you may be able to spare some time on reviewing.

@akaihola
Copy link
Owner Author

Now rebased on master after baseline linting removal.

@MatthijsBurgh
Copy link
Collaborator

Sorry, I don't have time for this one

- change to working directory
- install `pip-requirements-parser` in a separate step
- include Darker exit code in outputs
- include Darker standard output in outputs
- run `commit-range` action locally
- caching of the virtualenv and pip downloads
@akaihola akaihola removed the request for review from MatthijsBurgh September 30, 2024 13:07
@akaihola
Copy link
Owner Author

Still looking for a reviewer for this PR. You seem to have the ball rolling @clintonsteiner (thanks for all the effort!), would you be interested to look at this change to the GitHub action as well?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Development

Successfully merging this pull request may close these issues.

Darker github action ignores working-directory
2 participants