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

fix: remove husky internal files that should never have been committed #1608

Merged
merged 1 commit into from
Feb 28, 2025

Conversation

bradenmacdonald
Copy link
Contributor

@bradenmacdonald bradenmacdonald commented Feb 28, 2025

The files in .husky/_/ are supposed to be ignored by git, but two were somehow committed to this repo. This is causing problems like unrelated changes showing up in other PRs - see https://github.com/openedx/frontend-app-learning/pull/1567/files for an example.

This PR fixes it by removing those files. Developers will have to manually run npx husky to re-create these files after pulling the latest changes.

@openedx-webhooks openedx-webhooks added the open-source-contribution PR author is not from Axim or 2U label Feb 28, 2025
@openedx-webhooks
Copy link

Thanks for the pull request, @bradenmacdonald!

This repository is currently maintained by @openedx/committers-frontend-app-learning.

Once you've gone through the following steps feel free to tag them in a comment and let them know that your changes are ready for engineering review.

🔘 Get product approval

If you haven't already, check this list to see if your contribution needs to go through the product review process.

  • If it does, you'll need to submit a product proposal for your contribution, and have it reviewed by the Product Working Group.
    • This process (including the steps you'll need to take) is documented here.
  • If it doesn't, simply proceed with the next step.
🔘 Provide context

To help your reviewers and other members of the community understand the purpose and larger context of your changes, feel free to add as much of the following information to the PR description as you can:

  • Dependencies

    This PR must be merged before / after / at the same time as ...

  • Blockers

    This PR is waiting for OEP-1234 to be accepted.

  • Timeline information

    This PR must be merged by XX date because ...

  • Partner information

    This is for a course on edx.org.

  • Supporting documentation
  • Relevant Open edX discussion forum threads
🔘 Get a green build

If one or more checks are failing, continue working on your changes until this is no longer the case and your build turns green.


Where can I find more information?

If you'd like to get more details on all aspects of the review process for open source pull requests (OSPRs), check out the following resources:

When can I expect my changes to be merged?

Our goal is to get community contributions seen and reviewed as efficiently as possible.

However, the amount of time that it takes to review and merge a PR can vary significantly based on factors such as:

  • The size and impact of the changes that it introduces
  • The need for product review
  • Maintenance status of the parent repository

💡 As a result it may take up to several weeks or months to complete a review and merge your PR.

@@ -15,7 +15,7 @@
"i18n_extract": "fedx-scripts formatjs extract",
"lint": "fedx-scripts eslint --ext .js --ext .jsx --ext .ts --ext .tsx .",
"lint:fix": "fedx-scripts eslint --fix --ext .js --ext .jsx --ext .ts --ext .tsx .",
"prepare": "husky install",
"prepare": "husky",
Copy link
Contributor Author

Choose a reason for hiding this comment

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

The install command has been deprecated and now you simply run npx husky

@bradenmacdonald
Copy link
Contributor Author

@openedx/committers-frontend-app-learning FYI on this PR - it will require you to run a command after pulling the changes, to avoid random husky files showing up in git. Would someone by able to give me a quick review?

Copy link

codecov bot commented Feb 28, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 84.65%. Comparing base (da633ff) to head (7d4fbf6).
Report is 9 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1608      +/-   ##
==========================================
+ Coverage   84.62%   84.65%   +0.02%     
==========================================
  Files         332      332              
  Lines        5666     5683      +17     
  Branches     1397     1359      -38     
==========================================
+ Hits         4795     4811      +16     
- Misses        852      855       +3     
+ Partials       19       17       -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@KristinAoki
Copy link
Member

@bradenmacdonald I pulled your changes and am no longer getting the random husky file. However, I am still getting a husky deprecation warning.

> git -c user.useConfigOnly=true commit --quiet --allow-empty-message --file -
husky - DEPRECATED

Please remove the following two lines from .husky/pre-commit:

#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

They WILL FAIL in v10.0.0

.husky/pre-commit: line 4: npm: command not found
husky - pre-commit script failed (code 127)
husky - command not found in PATH=node_modules/.bin:/Library/Developer/CommandLineTools/usr/libexec/git-core:/usr/bin:/bin:/usr/sbin:/sbin

While making your changes did you see this as well?

@bradenmacdonald
Copy link
Contributor Author

@KristinAoki Thanks for catching that. For the first part, I have fixed it now, making that change as it says.

For the second part, I saw a similar error. It happens if node isn't on your path. For me, I needed to put export PATH="/opt/homebrew/opt/node@20/bin:$PATH" into ~/.config/husky/init.sh to make it work, but that was also needed before this change.

@bradenmacdonald bradenmacdonald merged commit ae04e5b into openedx:master Feb 28, 2025
7 checks passed
@bradenmacdonald bradenmacdonald deleted the braden/fix-gitignore branch February 28, 2025 18:18
@bradenmacdonald
Copy link
Contributor Author

Thanks @KristinAoki !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
open-source-contribution PR author is not from Axim or 2U
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

3 participants