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

feat: add developer-portal workflows #51

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

bojanrajh
Copy link
Contributor

@bojanrajh bojanrajh commented Feb 21, 2024

What?

3 new workflows for communicating with the DevHub:

  • developer-portal-healthcheck - triggers a new preview build in developer-portal for every PR targeting main branch in this repo
  • update-healthcheck - needed to update the PR status check from the previous workflow - will be replaced with a dedicated GitHub app to avoid usage of the PAT
  • deploy-developer-portal - triggers a new production build in developer-portal whenever the main branch has changed
  • DEV_HUB_PERSONAL_ACCESS_TOKEN - PAT, tmp

Why?

So we can automate DevHub actions.

How?

By adding a few workflows.

Testing?

Already used by shopware/docs, shopware/frontends, shopware/release-notes.

Screenshots (optional)

Anything Else?

Copy link

vercel bot commented Feb 21, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
meteor-admin-sdk-docs 🛑 Canceled (Inspect) Feb 21, 2024 3:34pm
meteor-component-library ✅ Ready (Inspect) Visit Preview 💬 Add feedback Feb 21, 2024 3:34pm

Copy link
Contributor

@Haberkamp Haberkamp left a comment

Choose a reason for hiding this comment

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

One workflow seems to be broken.

.gitignore Outdated Show resolved Hide resolved
@bojanrajh
Copy link
Contributor Author

One workflow seems to be broken.

It will work once the DEV_HUB_PERSONAL_ACCESS_TOKEN secret is set.

- main

jobs:
create-healthcheck:
Copy link
Contributor

Choose a reason for hiding this comment

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

I would rename this workflow and job to something that tells me this job creates a preview build. I understand a healthcheck as an Rest endpoint that you ping and you get a response back that the system is running without any issues.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This job does 3 things actually:

  • create a new "check run" in current repo
  • triggers full-build in developer-portal
  • updates status of the "check run" from the first step based on the result of the second step

(... continuing in the next comment).

@@ -0,0 +1,38 @@
# This workflow is triggered from developer-portal and updates the healthcheck status in the PR.
name: Update healthcheck
Copy link
Contributor

Choose a reason for hiding this comment

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

Here the same as above. I would rename this to something like "Update developer portal preview"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This workflow as well as passing the DEV_HUB_PERSONAL_ACCESS_TOKEN / PERSONAL_TOKEN secret is only needed to update the conclusion of the check run, but the workflow name is hardcoded a few lines above that.

To sum this up: naming is hard :D Let's keep them as they are for now (and miss- aligned with other repos) as I'm planning to replace all 3 workflows with a single app integration - https://github.com/shopware/devhub-github-app/blob/main/api/webhook.js

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants