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

Yarn issue checker: enforcing explicit dependency management documentation #1136

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 21 additions & 0 deletions .circleci/check_yarn_issues.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/bash

rm -rf node_modules
yarn install --check-files --no-progress --no-colors 2> temp_yarn_output.txt 1>/dev/null
touch yarn_issues_assessed.txt
grep -E "^(error|warning)" temp_yarn_output.txt > yarn_issues.txt

# skip all assessed errors and warnings
grep -vxFf yarn_issues_assessed.txt yarn_issues.txt > new_issues.txt

if [ -s new_issues.txt ]
then
echo "New not yet assessed yarn issues found:"
cat new_issues.txt
rm temp_yarn_output.txt yarn_issues.txt new_issues.txt
exit 1
fi

rm temp_yarn_output.txt yarn_issues.txt new_issues.txt


1 change: 1 addition & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ jobs:
- run:
command: |
export CONTEXT="production"
sh .circleci/check_yarn_issues.sh
yarn install
chmod +x deploy.sh
./deploy.sh
Expand Down
11 changes: 11 additions & 0 deletions DEPENDENCY_MANAGEMENT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# Dependency Management
This document describes the current status of our dependency management and dependency assessment.

# Never ignore errors and warnings
If `ỳarn` issues a `warning` or `error`then act on it and do an assessment.
Our CI/CD pipeline will check if there are warnings or errors that are new and not yet assessed.

# Assessment of warnings and errors
If you spot yarn errors and warnings then fix it. If you think it is safe to ignore them, then add the warning or error
message to our [ignore list](./yarn_issues_assessed.txt) and put a comment line above it to inform other developers
why it is safe to ignore this message.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ Live versions of the website are currently available in [German](https://www.dat
## Development

Datenanfragen.de is designed as a static website, running on [Hugo](https://gohugo.io/) and [Preact](https://preactjs.com/).
Dependency management is done with yarn and a project-specific [dependency management](DEPENDENCY_MANAGEMENT.md) style.

To build the project locally for development, follow these steps:

Expand Down
22 changes: 22 additions & 0 deletions yarn_issues_assessed.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# This file contains a list of YARN warnings and errors that are allowed to be skipped by our CI/CD pipeline.
# All YARN warnings and errors not listed here will trigger a pipeline fail (by intention).
# Add comments above each line to describe the reason why it is save to ignore this YARN warning or error

# Skip list incl reason:

# as of 2024-01-17 the team ignores this warning without providing a reason. Reason may get provided at a later point in time
warning " > [email protected]" has unmet peer dependency "algoliasearch@>= 3.1 < 5".
warning " > [email protected]" has unmet peer dependency "react@>= 16.3.0 < 19".
warning " > [email protected]" has unmet peer dependency "react-dom@>= 16.3.0 < 19".
warning "react-instantsearch-dom > [email protected]" has unmet peer dependency "algoliasearch@>= 3.1 < 5".
warning "react-instantsearch-dom > [email protected]" has unmet peer dependency "algoliasearch@>= 3.1 < 5".
warning "react-instantsearch-dom > [email protected]" has unmet peer dependency "react@>= 16.3.0 < 19".
warning " > [email protected]" has unmet peer dependency "react@>=0.14.0".
warning " > [email protected]" has unmet peer dependency "react-dom@>=0.14.0".
warning " > @this-dot/[email protected]" has incorrect peer dependency "cypress@< 12.6.0".
warning " > [email protected]" has incorrect peer dependency "eslint@^4.0.0 || ^5.0.0".
warning " > [email protected]" has incorrect peer dependency "postcss@^8.4.14".
warning " > [email protected]" has incorrect peer dependency "webpack@^5.0.0".
warning " > [email protected]" has incorrect peer dependency "stylelint@^8.0.0 || ^9.0.0 || ^10.0.0 || ^11.0.0 || ^12.0.0 || ^13.0.0".
warning " > [email protected]" has incorrect peer dependency "stylelint@10 - 13".
0