teammates icon indicating copy to clipboard operation
teammates copied to clipboard

[#11383] Workflow Automation

Open pPris opened this issue 2 years ago • 39 comments

Part of #11383

Brief description of PR

  • Labels newly opened PRs properly depending on if they're drafts or not
  • Relabells PRs and comments on the PR with links to failing checks
  • In depth description of the functionality is a bit too long so I'm not sure if i should add it here
  • Note that this pr adds two more dependencies to the repo, @actions/core and @actions/github

Structure of the files

  • Each folder under pr_management contains a code for a different action (main.ts/main.js) and an action.yml file that contains metadata.
    • each of these folders also contain an index.js file which is bundled using @vercel/ncc. Normally for github actions, node_modules have to be checked into the repo, however, this can be avoided by using the ncc module (this was also recommended in an official github tutorial)
    • the way i built the files requires a few different commands to be run so I added some scripts to package.json
  • Each yml file which is added to .github/workflows contains a workflow that runs on certain event triggers as specified in the file. (these are kept at the same level as e2e.yml, etc. because github did not recognise workflow files that aren't directly inside ./.github/workflow)
  • There is a common.ts file for API requests and other helper functions that keep getting repeated.

Demo https://github.com/pPris/pr-workflow-test/pull/37 https://github.com/pPris/pr-workflow-test/pull/40

Status

  • Open to review. Maybe tsconfig.json, changes to package.json could be reviewed. Also the documentation could be looked at (if there's anything I should add so it's less confusing for future devs working on this aspect)

pPris avatar Aug 13 '21 17:08 pPris

Hi @pPris, these parts of your pull request do not appear to follow our contributing guidelines:

  1. PR Title
    • Issue Reference (#<issue-number>) missing.
  2. PR Description
    • Issue Reference (#<issue-number>) missing.
    • Should contain GitHub keyword to auto-close issue it fixes: Refer here for a list of accepted keywords.

teammates-bot avatar Aug 13 '21 17:08 teammates-bot

Hi @pPris, these parts of your pull request do not appear to follow our contributing guidelines:

  1. PR Title
    • Issue Reference (#<issue-number>) missing.
  2. PR Description
    • Issue Reference (#<issue-number>) missing.
    • Should contain GitHub keyword to auto-close issue it fixes: Refer here for a list of accepted keywords.

teammates-bot avatar Aug 14 '21 16:08 teammates-bot

Hi @pPris, these parts of your pull request do not appear to follow our contributing guidelines:

  1. PR Title
    • Issue Reference (#<issue-number>) missing.
  2. PR Description
    • Issue Reference (#<issue-number>) missing.
    • Should contain GitHub keyword to auto-close issue it fixes: Refer here for a list of accepted keywords.

teammates-bot avatar Aug 16 '21 07:08 teammates-bot

Hi @pPris, these parts of your pull request do not appear to follow our contributing guidelines:

  1. PR Title
    • Issue Reference (#<issue-number>) missing.
  2. PR Description
    • Issue Reference (#<issue-number>) missing.
    • Should contain GitHub keyword to auto-close issue it fixes: Refer here for a list of accepted keywords.

teammates-bot avatar Aug 17 '21 15:08 teammates-bot

I've seen the review, just need some time to fix this

pPris avatar Aug 21 '21 05:08 pPris

Hi @pPris, these parts of your pull request do not appear to follow our contributing guidelines:

  1. PR Title
    • Issue Reference (#<issue-number>) missing.
  2. PR Description
    • Issue Reference (#<issue-number>) missing.
    • Should contain GitHub keyword to auto-close issue it fixes: Refer here for a list of accepted keywords.

teammates-bot avatar Aug 21 '21 20:08 teammates-bot

Hi @pPris, these parts of your pull request do not appear to follow our contributing guidelines:

  1. PR Title
    • Issue Reference (#<issue-number>) missing.
  2. PR Description
    • Issue Reference (#<issue-number>) missing.
    • Should contain GitHub keyword to auto-close issue it fixes: Refer here for a list of accepted keywords.

teammates-bot avatar Aug 21 '21 20:08 teammates-bot

Hi @pPris, these parts of your pull request do not appear to follow our contributing guidelines:

  1. PR Title
    • Issue Reference (#<issue-number>) missing.

teammates-bot avatar Aug 22 '21 07:08 teammates-bot

@pPris @daongochieu2810 let's not go too deep into refactoring for now - it is more important to ensure the functionality is correct.

rrtheonlyone avatar Aug 23 '21 09:08 rrtheonlyone

@pPris then I think you can ignore my comments for now, or make another issue for them

daongochieu2810 avatar Aug 23 '21 11:08 daongochieu2810

Sure i'll pause the refactorings and wait for comments on the functionality

pPris avatar Aug 24 '21 10:08 pPris

@pPris I will need some time to pull your repo and test on mine

daongochieu2810 avatar Aug 24 '21 15:08 daongochieu2810

@pPris @rrtheonlyone the functionality seems good on my repo

daongochieu2810 avatar Aug 25 '21 08:08 daongochieu2810

Thanks for checking @daongochieu2810.

Feel free to approve on your end if you are more or less satisfied with the code. (Again, let's not spend too much time on refactoring etc. - this one we can always do later.)

rrtheonlyone avatar Aug 25 '21 14:08 rrtheonlyone

I have some existing changes to copy over to this repo so I'll do that & address the last review by tonight

pPris avatar Aug 25 '21 16:08 pPris

I've committed all the changes I have for now. So if I'm understanding it right, we are merging this soon and then we can handle the rest of the refactorings in the next pr?

pPris avatar Aug 25 '21 19:08 pPris

@pPris no, not merging yet.

@daongochieu2810 needs to approve if he is okay with your current changes and we also need another set of reviews.

rrtheonlyone avatar Aug 25 '21 21:08 rrtheonlyone

@pPris before looking through the logic, I have some questions:

  • What are the steps needed if any of the TS file is modified? I have reasons to believe that it's not auto-updated.
  • This is not entirely related, but does the workflow file work if the script is in a submodule?

wkurniawan07 avatar Aug 26 '21 11:08 wkurniawan07

@wkurniawan07 Yep that's right, it's not auto updated. I use tsc to show the errors without emitting any compiled files, and then I use ncc to package all the code with the necessary node_modules files.

Because the commands are long, I added two scripts to package.json actions:tsc and actions:minify. So to answer the question, after changing the ts files, you can use npm run-script to run these two and it should be good to go.

About the submodule question, I'm not able to find the documentation for this. The docs do say that workflow files can reference actions of a specified version number in a different repo.

pPris avatar Aug 26 '21 12:08 pPris

Guys, This PR seems to be stalling (no activities for the past 7 days). :snail: :cry: Hope someone can get it to move forward again soon...

nusoss-bot avatar Sep 02 '21 14:09 nusoss-bot

@wkurniawan07 @ChooJeremy @madanalogy for your kind review. Thanks

hhdqirui avatar Sep 03 '21 18:09 hhdqirui

Hi @ChooJeremy Thank you for pointing that case out. I've added made the changes according to your review - here's a demo of the functionality added.

Some Technicalities: I've changed the phrase to comment to PR ready for review because there exists a github account called bot, and I also didn't want to remove the first word to avoid accidentally triggering the check.

The logic you outlined looks pretty much correct to me 👍

pPris avatar Sep 06 '21 17:09 pPris

@pPris let us know once this is ready for review again, thanks.

jianhandev avatar Sep 13 '21 15:09 jianhandev

@jianhandev Hi, this is ready for review, thanks

pPris avatar Sep 13 '21 15:09 pPris

Logic is good. @rrtheonlyone @madanalogy would you like to review? Or perhaps we should start refactoring.

ChooJeremy avatar Sep 13 '21 16:09 ChooJeremy

Guys, This PR seems to be stalling (no activities for the past 7 days). :snail: :cry: Hope someone can get it to move forward again soon...

nusoss-bot avatar Sep 21 '21 14:09 nusoss-bot

Looks great @pPris ! Thanks for the detailed review @ChooJeremy

Let me take a closer look over the coming week and see how we can get this running for us

rrtheonlyone avatar Sep 25 '21 13:09 rrtheonlyone

Guys, This PR seems to be stalling (no activities for the past 7 days). :snail: :cry: Hope someone can get it to move forward again soon...

nusoss-bot avatar Oct 02 '21 14:10 nusoss-bot

Guys, This PR seems to be stalling (no activities for the past 7 days). :snail: :cry: Hope someone can get it to move forward again soon...

nusoss-bot avatar Oct 10 '21 14:10 nusoss-bot

Guys, This PR seems to be stalling (no activities for the past 7 days). :snail: :cry: Hope someone can get it to move forward again soon...

nusoss-bot avatar Oct 17 '21 15:10 nusoss-bot