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: buildless ecosystem ci #18525

Open
wants to merge 60 commits into
base: main
Choose a base branch
from

Conversation

Aslemammad
Copy link
Contributor

By using the --commit option in vite-ecosystem-ci, we can leverage the already built versions of vite in pkg.pr.new!

Here, after sending the ecosystem comment, we'll check if there's an already built version, if not, we'll try triggering a build. The 🚀 reaction is a sign that the build is happening and we should wait until it's done.

After that, the normal process continues.

@Aslemammad
Copy link
Contributor Author

/ecosystem-ci run

Copy link

pkg-pr-new bot commented Nov 1, 2024

Open in Stackblitz

pnpm add https://pkg.pr.new/vitejs/vite@18525

commit: c97f0eb

@Aslemammad
Copy link
Contributor Author

/ecosystem-ci run

script: |
const prData = ${{ steps.get-pr-data.outputs.result }}
const url = `https://pkg.pr.new/vite@${prData.commit}`
const response = await fetch(url)
Copy link
Contributor Author

@Aslemammad Aslemammad Nov 5, 2024

Choose a reason for hiding this comment

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

We do not yet implement the HEAD for pkg.pr.new! So here instead of consuming the request body and waiting for it, we just check the status and then the step would be done.

So if it was fetching, it'd be aborted I 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.

Copy link
Contributor

@dominikg dominikg Nov 5, 2024

Choose a reason for hiding this comment

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

if you await fetch(), the full file has been downloaded already, its just not been parsed yet. of course if pkg.pr.new does not implement head we have to go with full, but should be considered as an optimization. or do you implement the endpoints about package information that the public registry has?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

if you await fetch(), the full file has been downloaded already

I did not know that, does not that defeat the purpose of streams (e.g. .body)?

As far as I know the await on .body would wait until finishing the fetch and meanwhile give us the result buffer by buffer while fetching.

but should be considered as an optimization

💯

Copy link
Contributor

Choose a reason for hiding this comment

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

hmm, maybe need to get more coffee and you are right.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Haha, thanks, let me get my own coffee too now 😅

Copy link

Choose a reason for hiding this comment

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

We do not yet implement the HEAD for pkg.pr.new!

Any plan to support it? It sounds interesting.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Any plan to support it? It sounds interesting.

I'll create an issue for it then!

@Aslemammad Aslemammad marked this pull request as ready for review November 5, 2024 09:25
@dominikg
Copy link
Contributor

dominikg commented Nov 5, 2024

/ecosystem-ci run

@Aslemammad
Copy link
Contributor Author

Aslemammad commented Nov 5, 2024 via email

@vite-ecosystem-ci
Copy link

📝 Ran ecosystem CI on 5406307: Open

suite result latest scheduled
astro failure failure
histoire failure failure
redwoodjs failure failure
remix failure failure
sveltekit failure failure
unocss failure failure
vike failure failure
vite-environment-examples failure success
vite-plugin-react success failure
vite-plugin-svelte success failure
vite-plugin-vue failure failure
vitest failure failure

analogjs, ladle, laravel, marko, nuxt, previewjs, quasar, qwik, rakkas, storybook, vite-plugin-pwa, vite-plugin-react-swc, vite-setup-catalogue, vitepress, vuepress

.github/workflows/ecosystem-ci-trigger.yml Outdated Show resolved Hide resolved
.github/workflows/ecosystem-ci-trigger.yml Outdated Show resolved Hide resolved
.github/workflows/ecosystem-ci-trigger.yml Show resolved Hide resolved
.github/workflows/ecosystem-ci-trigger.yml Outdated Show resolved Hide resolved
.github/workflows/ecosystem-ci-trigger.yml Outdated Show resolved Hide resolved
.github/workflows/ecosystem-ci-trigger.yml Outdated Show resolved Hide resolved
.github/workflows/ecosystem-ci-trigger.yml Outdated Show resolved Hide resolved
sapphi-red
sapphi-red previously approved these changes Nov 6, 2024
Copy link
Member

@sapphi-red sapphi-red left a comment

Choose a reason for hiding this comment

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

The code looks good to me 👍

.github/workflows/ecosystem-ci-trigger.yml Outdated Show resolved Hide resolved
Comment on lines 186 to 202
- name: Checkout
uses: actions/checkout@v4
with:
app_id: ${{ secrets.ECOSYSTEM_CI_GITHUB_APP_ID }}
installation_retrieval_payload: "${{ github.repository_owner }}/vite-ecosystem-ci"
private_key: ${{ secrets.ECOSYSTEM_CI_GITHUB_APP_PRIVATE_KEY }}
- uses: actions/github-script@v7
fetch-depth: 0

- name: Check Commit Hash Ambiguity
id: check_ambiguity
run: |
HEAD_SHA=${{ steps.get-pr-data.outputs.head_sha }}
COMMIT_SHORT=${HEAD_SHA:0:7}

if git show "$COMMIT_SHORT"; then
echo "COLLISION=false" >> $GITHUB_ENV
else
echo "COLLISION=true" >> $GITHUB_ENV
fi
Copy link
Member

Choose a reason for hiding this comment

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

Let me confirm when these steps can be removed. Is the following understanding right?

It cannot be removed now because even if we passed the full hash to pr.pkg.new, pr.pkg.new will try to match with 7char prefix if it didn't match with the full hash.
It can be removed after all the 7char is purged. How long does it take for that? If the date is known, could we have a comment that says "we can remove this in ..."?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

will try to match with 7char prefix

exactly, any release made before yesterday, will match the 7char version of commits (yesterday's release fixes that completely but only gets applied after the new commits)

if we do not use any of the releases made before for a month, it'd get remove! but if we keep using it, the timeline would be expanded to at most 6 months and at that time, it'd be force deleted.

Copy link
Member

Choose a reason for hiding this comment

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

I see. Then, would you add a comment telling that this part can be removed on May 26, 2025?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

done!

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.

5 participants