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

Add new "Check the label 'Needs autoupgrade PR'" workflow #36100

Merged
merged 1 commit into from May 13, 2024

Conversation

M0rgan01
Copy link
Contributor

@M0rgan01 M0rgan01 commented May 6, 2024

Questions Answers
Branch? develop
Description? Added a new workflow to automatically add the "needs autoupgrade PR" label to know if a modification of the database structure has been detected. The workflow allows you to remove the label automatically if not necessary. The process is very fast (less than 2 mins) and is not blocking an PR. This is to inform contributors as well as reviewers that a PR will have to be made on the autoupgrade module.
Type? improvement
Category? PM
BC breaks? no
Deprecations? no
How to test? Create a branch from it, make modifications to the database structure (db_structure.sql file or entities) and create a PR to the starting branch to trigger the CI (example here M0rgan01#14)
UI Tests -
Fixed issue or discussion? -
Related PRs -
Sponsor company -

image

@prestonBot prestonBot added develop Branch Improvement Type: Improvement labels May 6, 2024
@M0rgan01 M0rgan01 added this to the 9.0.0 milestone May 6, 2024
@M0rgan01 M0rgan01 marked this pull request as ready for review May 6, 2024 13:19
@M0rgan01 M0rgan01 requested a review from a team as a code owner May 6, 2024 13:19
ga-devfront
ga-devfront previously approved these changes May 6, 2024
Copy link
Contributor

@ga-devfront ga-devfront left a comment

Choose a reason for hiding this comment

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

All see good for me just a little suggestion about refacto

Comment on lines 9 to 38
name: Install Prestashop and create database dump for base branch
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Docker build
run: docker compose build prestashop-git

- name: Build dependency
run: docker compose run --rm prestashop-git composer install --ansi --prefer-dist --no-interaction --no-progress

- name: Create base database
run: docker compose run --rm mysql mysql -hmysql -uroot -pprestashop -e "CREATE DATABASE presta_base;"

- name: Install shop
run: docker compose run --rm prestashop-git php install-dev/index_cli.php \
--step=database --db_server=mysql:3306 --db_name=presta_base --db_user=root --db_password=prestashop --prefix=ps_ --db_clear=1 \
--domain=localhost:8001 --firstname="Marc" --lastname="Beier" \
--password=Toto123! --email=demo@prestashop.com --language=fr --country=fr \
--newsletter=0 --send_email=0 --ssl=0

- name: Export dump
run: docker compose run --rm mysql sh -c "exec mysqldump -hmysql -uroot --no-data --compact -pprestashop presta_base" > dump_base.sql

- name: Upload dump
uses: actions/upload-artifact@v4
with:
name: dump_base
path: |
dump_base.sql
Copy link
Contributor

Choose a reason for hiding this comment

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

I think we can refacto this part to not duplicate it and juste use reusable workflow with params. What do you think ?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Are you thinking of a matrix ? totally possible

Copy link
Contributor

Choose a reason for hiding this comment

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

I thought about using an action at first, but I guess a matrix would probably do the job better

Copy link
Contributor

Choose a reason for hiding this comment

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

Although I wouldn't block the PR just for this so it's up to you

nicosomb
nicosomb previously approved these changes May 6, 2024
jolelievre
jolelievre previously approved these changes May 6, 2024
Copy link
Contributor

@jolelievre jolelievre left a comment

Choose a reason for hiding this comment

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

Thanks @M0rgan01

@M0rgan01 M0rgan01 dismissed stale reviews from jolelievre, nicosomb, and ga-devfront via b4388dd May 7, 2024 07:44
@M0rgan01 M0rgan01 force-pushed the add_autoupgrade_CI_steps branch 2 times, most recently from b4388dd to c88d864 Compare May 7, 2024 07:59
@M0rgan01 M0rgan01 marked this pull request as draft May 7, 2024 08:05
@M0rgan01 M0rgan01 force-pushed the add_autoupgrade_CI_steps branch 4 times, most recently from 6c68fcc to d8b5240 Compare May 7, 2024 08:44
@M0rgan01 M0rgan01 marked this pull request as ready for review May 7, 2024 08:58
nicosomb
nicosomb previously approved these changes May 7, 2024
@M0rgan01 M0rgan01 marked this pull request as draft May 7, 2024 12:28
@M0rgan01 M0rgan01 force-pushed the add_autoupgrade_CI_steps branch 2 times, most recently from 34c97eb to da81440 Compare May 7, 2024 12:43
@M0rgan01 M0rgan01 marked this pull request as ready for review May 7, 2024 12:51
Copy link
Contributor

@jolelievre jolelievre left a comment

Choose a reason for hiding this comment

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

Thanks @M0rgan01

@ps-jarvis ps-jarvis added the Waiting for QA Status: action required, waiting for test feedback label May 13, 2024
@M0rgan01 M0rgan01 removed the Waiting for QA Status: action required, waiting for test feedback label May 13, 2024
@M0rgan01 M0rgan01 merged commit a14c60f into PrestaShop:develop May 13, 2024
35 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
develop Branch Improvement Type: Improvement
Projects
Status: To be tested
Development

Successfully merging this pull request may close these issues.

None yet

7 participants