-
-
Notifications
You must be signed in to change notification settings - Fork 8.6k
CI: Cleanup flatpak-builder-lint action #12377
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
base: master
Are you sure you want to change the base?
Conversation
@@ -7,16 +7,11 @@ inputs: | |||
path: | |||
description: Path to flatpak-builder manifest or Flatpak build directory | |||
required: true | |||
workingDirectory: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
As path
can be an absolute path but also potentially a relative path (that's the way it's used in the publish workflow right now), it needs to be relative to something.
The action cannot assume that the current working directory of the workflow that invoked it is actually the workspace directory or the root directory of a checkout, thus why this argument exists and uses the workspace as its default value.
This way the action by default establishes the state it needs to succeed and it also doesn't leak this requirement back into the workflow, which might need an entirely different working directory or might want to run the action for a secondary checkout created by the workflow itself.
The description should be updated of course, because it's not valid (it'd be more correct to say "Working directory to run flatpak-builder-lint from").
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
workingDirectory
is unused, there is nothing that uses it since a while and was meant as a destination to clone a third-party tool.
And this PR does not touch path
at all, so I'm more on the side to consider this review out of scope.
Edit: Also the action has a hard deps on the container image used by Flatpak CIs.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The working directory is used every time the action is invoked because it has a safe default value.
When flatpak-builder-lint
is invoked with the path build-aux/com.obsproject.Studio.json
(as happens in the publish workflow), then the path needs to point to a valid file.
If the calling workflow sets its working directory to some other path than the workspace, then the action would fail with these changes:
some_job:
defaults:
run:
working-directory: <somewhere outside the checkout>
steps:
- name: Validate Flatpak manifest
uses: ./.github/actions/flatpak-builder-lint
with:
artifact: manifest
path: build-aux/com.obsproject.Studio.json
Because <somewhere outside the checkout>/build-aux/com.obsproject.Studio.json
will not point to a valid file because of this change.
Otherwise the GitHub workspace would have been used as the default working directory, which is set for each step and thus the path would point to a valid file again. The actions are designed to work by default even if a workflow "forgot" that it has changed the working directory.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
While I understand the justification that the current use case may not directly benefit from defining workingDirectory here, it is considered best practice and all of our other updated actions use this paradigm. Since the runner images, or the checkout method, may change in the future this feels safe to still include as it doesn't harm anything.
Additionally, if you are removing something in a PR, and someone disagrees with that removal, stating their review is "out of scope" for your change is not really an acceptable comment just because you don't agree with them. The review is absolutely within scope; you're deleting something and someone is explaining why it shouldn't be deleted. That's about as in-scope of a review as it could possibly get. Please be mindful in the future, as those kinds of comments come across as dismissive.
825115d
to
69b224b
Compare
Replace jq usage with the new --gha-format option
69b224b
to
eeb64e4
Compare
Description
Remove unused workingDirectory input (was not removed alongside the replacement of a git clone with in-container pre-install)Motivation and Context
Was on my list of TODO about Flatpak stuff
How Has This Been Tested?
This PR is the test
Types of changes
Checklist: