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 CI action to sync published versions simple example to sandbox repository #10273

Merged
merged 8 commits into from
Oct 17, 2024

Conversation

djhi
Copy link
Collaborator

@djhi djhi commented Oct 11, 2024

Problem

As explained in #10252, Stackblitz is currently very slow. Besides, we can't use codesandbox to open a subpath of our monorepo anymore.

Solution

We now have a dedicated repository for the simple example: https://github.com/marmelab/react-admin-sandbox
This PR adds a CI action that sync the monorepo simple example with the sandbox repository.
It does so only when a new tag is released, except for next, beta and alpha tags

Additional Checks

  • The PR targets master for a bugfix, or next for a feature

@@ -157,7 +162,7 @@ jobs:
runs-on: ubuntu-latest
name: GreenFrame
needs: [e-commerce]
if: success() && github.ref == 'refs/heads/master'
if: success() && github.ref == 'refs/heads/master' && github.ref_type != 'tag'
Copy link
Contributor

Choose a reason for hiding this comment

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

thought: on the contrary, we could run the Greenframe analysis only when a new tag/version is released, as opposed to any commit on master which might be a little too often. Wdyt?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@fzaninotto any opinion?

Copy link
Member

Choose a reason for hiding this comment

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

I agree that we should only test greenframe when releasing a new version

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Done

- name: Use Node.js LTS
uses: actions/setup-node@v3
with:
node-version: '16.x'
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
node-version: '16.x'
node-version: '18.x'

To be consistent with other jobs of the workflow

Makefile Outdated
@@ -172,3 +172,6 @@ storybook: ## Launch the storybook
build-storybook: ## Build the storybook
@echo "Building storybook..."
@yarn build-storybook

update-sandbox: ## Push the local version of the simple example to the sandbox repository
./update-demo.sh
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
./update-demo.sh
./update-sandbox.sh

(there is no update-demo.sh)

node-version: '16.x'
- name: Update Sandbox Repository
env:
SSH_DEPLOY_KEY: ${{ secrets.SSH_SANDBOX_DEPLOY_KEY }}
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
SSH_DEPLOY_KEY: ${{ secrets.SSH_SANDBOX_DEPLOY_KEY }}
SSH_SANDBOX_DEPLOY_KEY: ${{ secrets.SSH_SANDBOX_DEPLOY_KEY }}

To be consistent with the actual script

Comment on lines 31 to 33
# Allow empty commits because even though we may have published new version of the enterprise packages,
# the demo code may not have changed. However we still want it to be redeployed and, as we don't keep its
# yarn.lock, it should use the new packages
Copy link
Contributor

Choose a reason for hiding this comment

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

I understand the rationale, but I believe @fzaninotto was in favor of actually computing and committing the yarn.lock file, in order to reduce the sandbox startup time

@djhi djhi added WIP Work In Progress and removed RFR Ready For Review labels Oct 11, 2024
@slax57 slax57 added this to the 5.3.0 milestone Oct 17, 2024
@slax57 slax57 merged commit 17e7669 into master Oct 17, 2024
15 checks passed
@slax57 slax57 deleted the sync-sandbox-repo branch October 17, 2024 12:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
RFR Ready For Review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants