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

Building this repository using webhook #31

Open
Shaikh-Ubaid opened this issue Aug 18, 2022 · 11 comments
Open

Building this repository using webhook #31

Shaikh-Ubaid opened this issue Aug 18, 2022 · 11 comments

Comments

@Shaikh-Ubaid
Copy link
Member

Looks like it can be done: https://kontent.ai/blog/how-to-trigger-github-action-using-webhook-with-no-code/

  # Allows external webhook trigger
  repository_dispatch:
    types:
      - webhook

Originally posted by @certik in #3 (comment)

@Shaikh-Ubaid
Copy link
Member Author

This is the missing piece that we need to (I guess) figure out and then (hopefully) things should work, that is:

  • if there are commits in lfortran master, the CI in this repository should get triggered and the site dev.lfortran.org should get updated.
  • if there are commits in lcompilers_frontend, the in this repository should get triggered and the site dev.lfortran.org should get updated. (This already works).

@Shaikh-Ubaid
Copy link
Member Author

doubt: Please, could someone possibly share if it should be the wasm_builds repository triggering the CI of this repository? Because the resources needed by this repository to build are available at wasm_builds, so until wasm_builds completes its build and deploy stages, we are unable to fetch the required files.

@certik
Copy link
Contributor

certik commented Aug 18, 2022

Right. Probably that's right. Note that there is a delay when publishing to the GitHub pages.

@Shaikh-Ubaid
Copy link
Member Author

Right. Probably that's right. Note that there is a delay when publishing to the GitHub pages.

Got it. Thank you for the clarification.

@certik
Copy link
Contributor

certik commented Aug 18, 2022

Just setup the webhook from lfortran --- after it pushes the commit into wasm_builds.

@certik
Copy link
Contributor

certik commented Aug 18, 2022

I think we have time at our CI due to the Windows build. So add 60s delay after "git push to wasm_builds", so that GitHub has enough time to publish the page, then issue the "webhook" from the same CI task at LFortran. That should work robustly.

@Shaikh-Ubaid
Copy link
Member Author

I think we have time at our CI due to the Windows build. So add 60s delay after "git push to wasm_builds", so that GitHub has enough time to publish the page, then issue the "webhook" from the same CI task at LFortran. That should work robustly.

Got it.

@Shaikh-Ubaid
Copy link
Member Author

This work flow https://github.com/lfortran/wasm_builds/actions/runs/2878330373 at wasm_builds took around 1 min, 7 secs. It seems 60 secs may not be robust. Shall we wait 120 secs?

@certik
Copy link
Contributor

certik commented Aug 18, 2022

Yes. And I wonder if we should not do automatic updates like this --- it seems very fragile.

We could create a PR after 120s in this repository, that updates the hash. Then we do not need to setup any webhooks, we just create a PR, and the CI in this repository will run and upload a testing website and we can manually review that everything works, and then just merge manually.

And if we want things to work automatically, we can later set "merge if pipeline succeeds" button at the PR.

So I think that is a better design, more robust. What do you think?

@Shaikh-Ubaid
Copy link
Member Author

What do you think?

It seems #24 might be a possible solution.

We could create a PR after 120s in this repository, that updates the hash. Then we do not need to setup any webhooks, we just create a PR, and the CI in this repository will run and upload a testing website and we can manually review that everything works, and then just merge manually.

Automated commits might/would have looked nice. Though, this approach also seems fine.

@certik
Copy link
Contributor

certik commented Aug 18, 2022

I am not opposed, but I am worried about the complexity / fragility. It's hard to add just one latest commit automatically, so far we didn't manage. So the PR approach seems like something that we can manage, and we can iteratively improve it (up to and including full automation), while being 100% robust at every step all the time.

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

No branches or pull requests

2 participants