Skip to content

Conversation

ladamski
Copy link
Collaborator

@ladamski ladamski commented Oct 3, 2025

Task/Issue URL: https://app.asana.com/1/137249556945/project/1171671347221384/task/1210907475542624

Description

Initial support for https://app.asana.com/1/137249556945/project/1209805270658160/list/1209805324244987
Specific subtask for this PR: https://app.asana.com/1/137249556945/task/1210907475542626

Steps to test this PR

https://app.asana.com/1/137249556945/task/1209901985192016?focus=true using ".../Android/PixelDefinitions/" as the target directory where specified

Feature 1

  • [ ]
  • [ ]

UI changes

Before After
!(Upload before screenshot) (Upload after screenshot)

Lucas Adamski added 2 commits October 6, 2025 21:12
@ladamski ladamski marked this pull request as ready for review October 7, 2025 20:08
@ladamski ladamski requested a review from nshuba October 7, 2025 20:08
Comment on lines 43 to 64
# Lint step for push (fail on error), for PRs run fix instead
- name: Check or Fix lint
id: lint
run: |
if [[ "${{ github.event_name }}" == "pull_request" ]]; then
npm run lint.fix || true
else
npm run lint
fi
working-directory: PixelDefinitions

# Commit and push changes if lint.fix was run and made changes
- name: Commit and push linter fixes (PRs only)
if: github.event_name == 'pull_request'
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git add PixelDefinitions/
if ! git diff --cached --quiet; then
git commit -m "chore: auto-fix lint errors"
git push
fi
Copy link
Collaborator

Choose a reason for hiding this comment

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

Let's check with the Android team if they are ok with automated commits. Windows opted into this, but Apple preferred a simple diff output on error: https://app.asana.com/1/137249556945/project/414709148257752/task/1210957466937460?focus=true

Copy link
Contributor

Choose a reason for hiding this comment

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

Bringing my comment:

  • lint should always run in PRs and develop and should be added to our pre-commit hook (this las bit needs added).
  • lint-fix should be run manually by the owner.
  • No automated commits anywhere.

Lucas Adamski added 2 commits October 8, 2025 09:37
@ladamski ladamski requested a review from cmonfortep October 9, 2025 05:43

on:
push:
branches: [develop]
Copy link
Contributor

Choose a reason for hiding this comment

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

this is not needed, validation should only run on PR commits and not when the PR is merged. The PR won’t be merged if there are lint issues.

Copy link
Collaborator Author

@ladamski ladamski Oct 10, 2025

Choose a reason for hiding this comment

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

I don't have a personal preference here, other than to note that:

Copy link
Contributor

Choose a reason for hiding this comment

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

Yeah I think it should run on develop too, wouldn't be the first time we have issues post-merge because of some weird randomness.

if [[ "${{ github.event_name }}" == "pull_request" ]]; then
npm run lint.fix || true
else
npm run lint
Copy link
Contributor

Choose a reason for hiding this comment

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

We can do this as part of our https://github.com/duckduckgo/Android/blob/develop/.github/workflows/ci.yml that runs on each PR merge. That would also prevent this workflow from running in parallel.

Copy link
Collaborator

Choose a reason for hiding this comment

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

My preference would be to have the pixel linter separated out so everything pixel validation related is in one workflow. This matches what we have done on other platforms and will make it easier to then consolidate into a shareable workflow in https://github.com/duckduckgo/native-github-asana-sync once we are more stable.

Copy link
Collaborator Author

@ladamski ladamski Oct 10, 2025

Choose a reason for hiding this comment

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

Since we aren't actually committing anything, I think it makes sense to run it in parallel? I've also scoped it down to only trigger on

      paths:
      - 'PixelDefinitions/**'

... so it won't even show up on most PRs

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@marcosholgado , @malmstein really appreciate your feedback here!

As @nshuba mentioned above, our longer term goal is to consolidate the common components across 6+ products into a shared one. As such I'd like to see if the current state is acceptable. To summarize:

  • package.json stays in the PixelDefinitions subdirectory
  • a separate pixel-validation.yml runs only for PR with commits in the PixelDefinitions subdirectory
  • fail on error, no auto fixing / committing

Copy link
Contributor

Choose a reason for hiding this comment

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

Re package.json 👍
Re fail on error, no auto fixing / committing 👍

I think it should run on develop too and it should be added to the pre-commit hook too so we don't have to run the whole CI to note that something failed. In fact, I think the pre-commit should run lint.fix and CI only lint.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@marcosholgado @malmstein I reverted to running against develop, and added a pre-commit for lint.fix.

Please take a look at the latter in particular as I'm not too familiar with the Git pre-commit workflows.

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.

4 participants