Skip to content

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tytan652
Copy link
Collaborator

@tytan652 tytan652 commented Jul 12, 2025

Description

  • Replace jq usage with the new --gha-format option
  • 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

  • Code cleanup (non-breaking change which makes code smaller or more readable)

Checklist:

  • My code has been run through clang-format.
  • I have read the contributing document.
  • My code is not on the master branch.
  • The code has been tested.
  • All commit messages are properly formatted and commits squashed where appropriate.
  • I have included updates to all appropriate documentation.

@tytan652 tytan652 added Code Cleanup Non-breaking change which makes code smaller or more readable CI labels Jul 12, 2025
@@ -7,16 +7,11 @@ inputs:
path:
description: Path to flatpak-builder manifest or Flatpak build directory
required: true
workingDirectory:
Copy link
Member

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").

Copy link
Collaborator Author

@tytan652 tytan652 Jul 12, 2025

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.

Copy link
Member

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.

Copy link
Member

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.

@tytan652 tytan652 force-pushed the flatpak-builder-lint_cleanups branch from 825115d to 69b224b Compare July 16, 2025 17:31
Replace jq usage with the new --gha-format option
@tytan652 tytan652 force-pushed the flatpak-builder-lint_cleanups branch from 69b224b to eeb64e4 Compare July 16, 2025 18:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CI Code Cleanup Non-breaking change which makes code smaller or more readable
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants