From 406cd874274623d26b36861cfbca832867fc9c02 Mon Sep 17 00:00:00 2001 From: Xavier Medrano Date: Thu, 14 Mar 2024 16:54:57 -0400 Subject: [PATCH 1/7] WIP test update action on this branch --- .github/workflows/main.yml | 41 ++++++++++++++++++++++++++++++++++++++ .gitignore | 1 + 2 files changed, 42 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..9c020fc --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,41 @@ +name: Check for dependency upgrades + +# on: +# schedule: +# # TODO: change this to be once a week or similar +# - cron: '30 5 * * 1,3' +on: + push: + branches: + # TODO: test event, will change + - feature/dependency-auto-update + +jobs: + upgrade-dependencies: + name: Check for dependency upgrades + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Activate a virtual environment + run: python -m venv .venv && source .venv/bin/activate + - name: Install pip-upgrader + run: pip install pip-upgrader + - name: Update python dependencies + run: | + find ./docker -name requirements.txt -exec pip-upgrade {} --skip-package-installation -p all \; + - name: Update node dependencies + run: | + source .venv/bin/activate && \ + pip install nodeenv && \ + nodeenv -p && \ + npm install -g npm-check-updates && \ + find ./docker -name package.json -exec ncu --packageFile {} -u \; + # TODO: push to the proper branch + - name: Push to main branch + run: | + git config --global user.name "xmedr" + git config --global user.email "xavier.medrano@datamade.us" + + git add . + git commit -m "Update pypi and node dependencies" + git push origin feature/dependency-auto-update diff --git a/.gitignore b/.gitignore index e43b0f9..2fd794b 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ .DS_Store +.venv From cd15ee287aad28bf06d7c89cd3bf738dfd6ef3e3 Mon Sep 17 00:00:00 2001 From: xmedr Date: Thu, 14 Mar 2024 20:55:43 +0000 Subject: [PATCH 2/7] Update pypi and node dependencies --- .../{{cookiecutter.app_name}}/package.json | 44 +++++++++--------- .../{{cookiecutter.app_name}}/package.json | 38 +++++++-------- .../package.json | 6 +-- .../{{ cookiecutter.app_name }}/package.json | 46 +++++++++---------- .../requirements.txt | 32 ++++++------- 5 files changed, 83 insertions(+), 83 deletions(-) diff --git a/docker/templates/new-django-app/{{cookiecutter.app_name}}/package.json b/docker/templates/new-django-app/{{cookiecutter.app_name}}/package.json index 395c362..ab39cd4 100644 --- a/docker/templates/new-django-app/{{cookiecutter.app_name}}/package.json +++ b/docker/templates/new-django-app/{{cookiecutter.app_name}}/package.json @@ -3,39 +3,39 @@ "version": "0.0.0", "description": "JavaScript development setup for {{cookiecutter.app_verbose_name}}", "dependencies": { - "@babel/cli": "^7.21.0", - "@babel/core": "^7.21.0", - "@babel/preset-env": "^7.20.2", - "@babel/preset-react": "^7.18.6", + "@babel/cli": "^7.23.9", + "@babel/core": "^7.24.0", + "@babel/preset-env": "^7.24.0", + "@babel/preset-react": "^7.23.3", "babel-preset-env": "^1.7.0", "babelify": "^10.0.0", - "bootstrap": "^5.2.3", + "bootstrap": "^5.3.3", "browserify": "^17.0.0", - "core-js": "^3.8.3", + "core-js": "^3.36.0", "react": "^18.2.0", "react-dom": "^18.2.0", - "sass": "^1.57.1" + "sass": "^1.72.0" }, "devDependencies": { - "@typescript-eslint/eslint-plugin": "^5.53.0", - "@typescript-eslint/parser": "^5.53.0", - "@babel/eslint-parser": "^7.19.1", - "babel-loader": "^9.1.0", + "@typescript-eslint/eslint-plugin": "^7.2.0", + "@typescript-eslint/parser": "^7.2.0", + "@babel/eslint-parser": "^7.23.10", + "babel-loader": "^9.1.3", "browserify-css": "^0.15.0", - "css-loader": "^6.7.2", - "eslint": "^8.34.0", - "eslint-config-prettier": "^8.7.0", + "css-loader": "^6.10.0", + "eslint": "^8.57.0", + "eslint-config-prettier": "^9.1.0", "eslint-config-react-app": "^7.0.1", "eslint-plugin-flowtype": "^8.0.3", - "eslint-plugin-import": "^2.27.5", - "eslint-plugin-jsx-a11y": "^6.7.1", - "eslint-plugin-react": "^7.32.2", + "eslint-plugin-import": "^2.29.1", + "eslint-plugin-jsx-a11y": "^6.8.0", + "eslint-plugin-react": "^7.34.0", "eslint-plugin-react-hooks": "^4.6.0", - "style-loader": "^3.3.1", - "webpack": "^5.75.0", - "webpack-bundle-tracker": "^1.7.0", - "webpack-cli": "^5.0.0", - "webpack-dev-server": "^4.11.1" + "style-loader": "^3.3.4", + "webpack": "^5.90.3", + "webpack-bundle-tracker": "^3.0.1", + "webpack-cli": "^5.1.4", + "webpack-dev-server": "^5.0.3" }, "scripts": { "develop": "sass --watch /app/{{ cookiecutter.module_name }}/static/scss/custom.scss:/app/{{ cookiecutter.module_name }}/static/css/bootstrap.custom.css", diff --git a/docker/templates/new-gatsby-app/{{cookiecutter.app_name}}/package.json b/docker/templates/new-gatsby-app/{{cookiecutter.app_name}}/package.json index f944e0c..1acff37 100644 --- a/docker/templates/new-gatsby-app/{{cookiecutter.app_name}}/package.json +++ b/docker/templates/new-gatsby-app/{{cookiecutter.app_name}}/package.json @@ -5,35 +5,35 @@ "version": "0.1.0", "author": "DataMade", "dependencies": { - "@babel/core": "^7.21.3", - "@babel/eslint-parser": "^7.21.3", - "@babel/plugin-syntax-flow": "^7.14.5", - "@babel/plugin-transform-react-jsx": "^7.14.9", + "@babel/core": "^7.24.0", + "@babel/eslint-parser": "^7.23.10", + "@babel/plugin-syntax-flow": "^7.23.3", + "@babel/plugin-transform-react-jsx": "^7.23.4", "@gatsbyjs/reach-router": "^2.0.1", - "@popperjs/core": "^2.11.6", - "@sentry/gatsby": "^7.44.2", + "@popperjs/core": "^2.11.8", + "@sentry/gatsby": "^7.107.0", "babel-eslint": "^10.0.0", - "bootstrap": "^5.2.3", + "bootstrap": "^5.3.3", "common-tags": "^1.8.2", - "eslint": "^8.36.0", + "eslint": "^8.57.0", "eslint-config-react-app": "^7.0.1", - "gatsby": "^5.8.0", - "gatsby-plugin-google-analytics": "^5.8.0", - "gatsby-plugin-image": "^3.8.0", - "gatsby-plugin-manifest": "^5.8.0", - "gatsby-plugin-react-helmet": "^6.8.0", - "gatsby-plugin-sharp": "^5.8.0", - "gatsby-source-filesystem": "^5.8.0", - "gatsby-transformer-sharp": "^5.8.0", + "gatsby": "^5.13.3", + "gatsby-plugin-google-analytics": "^5.13.1", + "gatsby-plugin-image": "^3.13.1", + "gatsby-plugin-manifest": "^5.13.1", + "gatsby-plugin-react-helmet": "^6.13.1", + "gatsby-plugin-sharp": "^5.13.1", + "gatsby-source-filesystem": "^5.13.1", + "gatsby-transformer-sharp": "^5.13.1", "prop-types": "^15.8.1", "react": "^18.2.0", - "react-bootstrap": "^2.7.2", + "react-bootstrap": "^2.10.1", "react-dom": "^18.2.0", "react-helmet": "^6.1.0", - "typescript": "^5.0.2" + "typescript": "^5.4.2" }, "devDependencies": { - "prettier": "^2.8.6" + "prettier": "^3.2.5" }, "keywords": [ "gatsby" diff --git a/docker/templates/new-vanilla-js-app/{{cookiecutter.directory_name}}/package.json b/docker/templates/new-vanilla-js-app/{{cookiecutter.directory_name}}/package.json index e164caa..6ad16f2 100644 --- a/docker/templates/new-vanilla-js-app/{{cookiecutter.directory_name}}/package.json +++ b/docker/templates/new-vanilla-js-app/{{cookiecutter.directory_name}}/package.json @@ -4,11 +4,11 @@ "version": "0.0.0", "description": "{{cookiecutter.app_description}}", "dependencies": { - "@babel/core": "^7.14.6", - "@babel/preset-env": "^7.14.7", + "@babel/core": "^7.24.0", + "@babel/preset-env": "^7.24.0", "babelify": "^10.0.0", "browserify": "^17.0.0", - "core-js": "^3.15.2", + "core-js": "^3.36.0", "watchify": "^4.0.0" }, "scripts": { diff --git a/docker/templates/new-wagtail-app/{{ cookiecutter.app_name }}/package.json b/docker/templates/new-wagtail-app/{{ cookiecutter.app_name }}/package.json index 2aef342..9ecf73f 100644 --- a/docker/templates/new-wagtail-app/{{ cookiecutter.app_name }}/package.json +++ b/docker/templates/new-wagtail-app/{{ cookiecutter.app_name }}/package.json @@ -3,37 +3,37 @@ "version": "0.0.0", "description": "JavaScript development setup for {{ cookiecutter.module_name }}", "dependencies": { - "@babel/cli": "^7.17.10", - "@babel/core": "^7.17.12", - "@babel/preset-env": "^7.17.12", - "@babel/preset-react": "^7.17.12", + "@babel/cli": "^7.23.9", + "@babel/core": "^7.24.0", + "@babel/preset-env": "^7.24.0", + "@babel/preset-react": "^7.23.3", "babel-preset-env": "^1.7.0", "babelify": "^10.0.0", "browserify": "^17.0.0", - "bootstrap": "^5.2.3", - "leaflet": "^1.8.0", + "bootstrap": "^5.3.3", + "leaflet": "^1.9.4", "leaflet-loading": "^0.1.24", "object-hash": "^3.0.0", - "react": "^18.1.0", - "react-dom": "^18.1.0", - "react-dropdown-select": "^4.7.4", - "react-leaflet": "^4.0.0", - "react-select": "^5.1.0", - "sass": "^1.57.1", - "typed.js": "^2.0.12" + "react": "^18.2.0", + "react-dom": "^18.2.0", + "react-dropdown-select": "^4.11.2", + "react-leaflet": "^4.2.1", + "react-select": "^5.8.0", + "sass": "^1.72.0", + "typed.js": "^2.1.0" }, "devDependencies": { - "@typescript-eslint/eslint-plugin": "^5.25.0", - "@typescript-eslint/parser": "^5.25.0", - "@babel/eslint-parser": "^7.17.0", - "eslint": "^8.6.0", - "eslint-config-prettier": "^8.7.0", + "@typescript-eslint/eslint-plugin": "^7.2.0", + "@typescript-eslint/parser": "^7.2.0", + "@babel/eslint-parser": "^7.23.10", + "eslint": "^8.57.0", + "eslint-config-prettier": "^9.1.0", "eslint-config-react-app": "^7.0.1", - "eslint-plugin-flowtype": "^5.2.0", - "eslint-plugin-import": "^2.22.1", - "eslint-plugin-jsx-a11y": "^6.4.1", - "eslint-plugin-react": "^7.21.5", - "eslint-plugin-react-hooks": "^4.2.0" + "eslint-plugin-flowtype": "^8.0.3", + "eslint-plugin-import": "^2.29.1", + "eslint-plugin-jsx-a11y": "^6.8.0", + "eslint-plugin-react": "^7.34.0", + "eslint-plugin-react-hooks": "^4.6.0" }, "scripts": { "develop": "sass --watch /app/{{ cookiecutter.module_name }}/static/scss/custom.scss:/app/{{ cookiecutter.module_name }}/static/css/bootstrap.custom.css" diff --git a/docker/templates/new-wagtail-app/{{ cookiecutter.app_name }}/requirements.txt b/docker/templates/new-wagtail-app/{{ cookiecutter.app_name }}/requirements.txt index 23e3d52..b5fde6d 100644 --- a/docker/templates/new-wagtail-app/{{ cookiecutter.app_name }}/requirements.txt +++ b/docker/templates/new-wagtail-app/{{ cookiecutter.app_name }}/requirements.txt @@ -1,18 +1,18 @@ -Django==3.2.11 -psycopg2==2.9.3 -gunicorn==20.1.0 -dj-database-url==0.5.0 -whitenoise==5.2.0 -django-compressor==4.0 -django-storages==1.12.3 -boto3==1.23.3 -sentry-sdk==0.20.3 -wagtail==3.0 -csvkit==1.0.7 +Django==5.0.3 +psycopg2==2.9.9 +gunicorn==21.2.0 +dj-database-url==2.1.0 +whitenoise==6.6.0 +django-compressor==4.4 +django-storages==1.14.2 +boto3==1.34.63 +sentry-sdk==1.42.0 +wagtail==6.0.1 +csvkit==1.4.0 -pytest==6.2.2 -pytest-django==4.5.2 -pytest-mock==3.7.0 -flake8==3.8.4 +pytest==8.1.1 +pytest-django==4.8.0 +pytest-mock==3.12.0 +flake8==7.0.0 -pip-chill==1.0.1 +pip-chill==1.0.3 From fcbf4d1786e7d2c74ab09b5f1b5f07e2cb15be9a Mon Sep 17 00:00:00 2001 From: Xavier Medrano Date: Thu, 14 Mar 2024 17:05:54 -0400 Subject: [PATCH 3/7] WIP test a scheduled job --- .github/workflows/main.yml | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 9c020fc..fcbcd6d 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,14 +1,9 @@ name: Check for dependency upgrades -# on: -# schedule: -# # TODO: change this to be once a week or similar -# - cron: '30 5 * * 1,3' on: - push: - branches: - # TODO: test event, will change - - feature/dependency-auto-update + schedule: + # - cron: '30 5 * * 0' + - cron: '30 5 * * *' jobs: upgrade-dependencies: @@ -30,7 +25,7 @@ jobs: nodeenv -p && \ npm install -g npm-check-updates && \ find ./docker -name package.json -exec ncu --packageFile {} -u \; - # TODO: push to the proper branch + # TODO: push to the proper branch after pr approved - name: Push to main branch run: | git config --global user.name "xmedr" From 59a9d83468373db21c76fd9daf50828597a973f3 Mon Sep 17 00:00:00 2001 From: Xavier Medrano Date: Fri, 15 Mar 2024 09:35:55 -0400 Subject: [PATCH 4/7] testing scheduled cron job --- .github/workflows/main.yml | 4 +-- .../requirements.txt | 32 +++++++++---------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index fcbcd6d..60bfde9 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -2,8 +2,8 @@ name: Check for dependency upgrades on: schedule: - # - cron: '30 5 * * 0' - - cron: '30 5 * * *' + # - cron: '30 5 * * *' + - cron: '37 13 * * *' jobs: upgrade-dependencies: diff --git a/docker/templates/new-wagtail-app/{{ cookiecutter.app_name }}/requirements.txt b/docker/templates/new-wagtail-app/{{ cookiecutter.app_name }}/requirements.txt index b5fde6d..23e3d52 100644 --- a/docker/templates/new-wagtail-app/{{ cookiecutter.app_name }}/requirements.txt +++ b/docker/templates/new-wagtail-app/{{ cookiecutter.app_name }}/requirements.txt @@ -1,18 +1,18 @@ -Django==5.0.3 -psycopg2==2.9.9 -gunicorn==21.2.0 -dj-database-url==2.1.0 -whitenoise==6.6.0 -django-compressor==4.4 -django-storages==1.14.2 -boto3==1.34.63 -sentry-sdk==1.42.0 -wagtail==6.0.1 -csvkit==1.4.0 +Django==3.2.11 +psycopg2==2.9.3 +gunicorn==20.1.0 +dj-database-url==0.5.0 +whitenoise==5.2.0 +django-compressor==4.0 +django-storages==1.12.3 +boto3==1.23.3 +sentry-sdk==0.20.3 +wagtail==3.0 +csvkit==1.0.7 -pytest==8.1.1 -pytest-django==4.8.0 -pytest-mock==3.12.0 -flake8==7.0.0 +pytest==6.2.2 +pytest-django==4.5.2 +pytest-mock==3.7.0 +flake8==3.8.4 -pip-chill==1.0.3 +pip-chill==1.0.1 From f0d9a76e9701aeb99adb35b69b008ba67599882b Mon Sep 17 00:00:00 2001 From: Xavier Medrano Date: Fri, 15 Mar 2024 09:46:38 -0400 Subject: [PATCH 5/7] run job at 5:30 utc --- .github/workflows/main.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 60bfde9..7854cc2 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -2,8 +2,7 @@ name: Check for dependency upgrades on: schedule: - # - cron: '30 5 * * *' - - cron: '37 13 * * *' + - cron: '30 5 * * *' jobs: upgrade-dependencies: From 1da9c7dc2f7b2fd9a930d523239018a1800b5141 Mon Sep 17 00:00:00 2001 From: Xavier Medrano Date: Fri, 15 Mar 2024 09:58:18 -0400 Subject: [PATCH 6/7] run job every sunday --- .github/workflows/main.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 7854cc2..26d4558 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -2,7 +2,7 @@ name: Check for dependency upgrades on: schedule: - - cron: '30 5 * * *' + - cron: '30 5 * * 0' jobs: upgrade-dependencies: From ef2ff7ca49ed000a9b4053d8f7284452cd511f84 Mon Sep 17 00:00:00 2001 From: Xavier Medrano Date: Wed, 10 Apr 2024 16:21:15 -0400 Subject: [PATCH 7/7] use context variable to decide which branch to auto update dependencies --- .github/workflows/main.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 26d4558..c9fcd53 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -24,7 +24,6 @@ jobs: nodeenv -p && \ npm install -g npm-check-updates && \ find ./docker -name package.json -exec ncu --packageFile {} -u \; - # TODO: push to the proper branch after pr approved - name: Push to main branch run: | git config --global user.name "xmedr" @@ -32,4 +31,4 @@ jobs: git add . git commit -m "Update pypi and node dependencies" - git push origin feature/dependency-auto-update + git push origin ${{ github.ref_name }}