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

[$500] [HOLD for payment 2023-12-06] Local testing of GitHub Actions #13604

Closed
roryabraham opened this issue Dec 15, 2022 · 26 comments
Closed

[$500] [HOLD for payment 2023-12-06] Local testing of GitHub Actions #13604

roryabraham opened this issue Dec 15, 2022 · 26 comments
Assignees
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 Engineering External Added to denote the issue can be worked on by a contributor NewFeature Something to build that is a new item. Not a priority

Comments

@roryabraham
Copy link
Contributor

roryabraham commented Dec 15, 2022

Problem

There is no easy way to locally test our GitHub Actions.

Why this is important

When we make changes to GitHub Actions, it's difficult to generate confidence that a PR will work and do what it is intended. This creates headaches:

  • It's harder to review GitHub Actions PRs and they need to be reviewed more carefully
  • We need to live-test things which is often disruptive
  • The best approximation is testing using another repo. We often use https://github.com/Andrew-Test-Org/Public-Test-Repo), but still the workflows you're testing there are not the same as the one's you're testing in E/App, and there may be different constraints in place, etc...
  • There's a slower feedback loop with simple mistakes in Actions and Workflows, leading to development taking longer

Solution

Implement a local testing framework for GitHub Actions using https://github.com/nektos/act

Issue OwnerCurrent Issue Owner: @muttmuure
Upwork Automation - Do Not Edit
  • Upwork Job URL: https://www.upwork.com/jobs/~016c26e8384c322e36
  • Upwork Job ID: 1734891845984043008
  • Last Price Increase: 2023-12-13
@roryabraham roryabraham added Monthly KSv2 NewFeature Something to build that is a new item. labels Dec 15, 2022
@melvin-bot melvin-bot bot locked and limited conversation to collaborators Dec 15, 2022
@Expensify Expensify unlocked this conversation Jan 26, 2023
@radoslawkrzemien
Copy link
Contributor

I'd like to have a look at this

@melvin-bot melvin-bot bot added the Overdue label Jan 26, 2023
@mountiny mountiny changed the title [HOLD] Local testing of GitHub Actions Local testing of GitHub Actions Jan 26, 2023
@mountiny mountiny added Weekly KSv2 and removed Monthly KSv2 labels Jan 26, 2023
@melvin-bot melvin-bot bot removed the Overdue label Jan 26, 2023
@melvin-bot melvin-bot bot removed the Overdue label Jan 26, 2023
@mountiny mountiny removed the Monthly KSv2 label Jan 26, 2023
@melvin-bot melvin-bot bot added Overdue Monthly KSv2 and removed Weekly KSv2 labels Feb 14, 2023
@MelvinBot
Copy link

This issue has not been updated in over 15 days. @radoslawkrzemien eroding to Monthly issue.

P.S. Is everyone reading this sure this is really a near-term priority? Be brave: if you disagree, go ahead and close it out. If someone disagrees, they'll reopen it, and if they don't: one less thing to do!

@melvin-bot melvin-bot bot removed the Overdue label Feb 20, 2023
@Prince-Mendiratta
Copy link
Contributor

Prince-Mendiratta commented Feb 20, 2023

Is this open for contribution from external contributors? If @radoslawkrzemien is not interested in working on this anymore, I'd like to work on this!

I've worked with Github Actions before and here is a proposal that I made on another issue concerning github actions - #14088 (comment)

cc @mountiny @roryabraham

@radoslawkrzemien
Copy link
Contributor

Hi @Prince-Mendiratta , just wanted to confirm that I am indeed working on this issue 🙂

radoslawkrzemien added a commit to radoslawkrzemien/App that referenced this issue Feb 21, 2023
Updated the `.gitignore` file with the temporary folder created by
the `Mock-github` package, in case the cleanup was not performed for
any reason

See: Expensify#13604
radoslawkrzemien added a commit to radoslawkrzemien/App that referenced this issue Feb 21, 2023
Added new packages, most importantly `Mock-github` for creating a
local repository for testing (to have better control over which
files are accessed by the locally run workflows) and `Act-js` for
programatically triggering the workflows with Act (with features
added on top of it, like mocking API calls, mocking steps, etc.)

See: Expensify#13604
radoslawkrzemien added a commit to radoslawkrzemien/App that referenced this issue Feb 21, 2023
Added `jest` and `ts` config files in a new folder `workflow_tests`
for the testing of GitHub Actions workflows

See: Expensify#13604
radoslawkrzemien added a commit to radoslawkrzemien/App that referenced this issue Feb 21, 2023
Added the stub of the first proper test, with the more-or-less defined structure, but yet without proper step mocks and result assertions

See: Expensify#13604
radoslawkrzemien added a commit to radoslawkrzemien/App that referenced this issue Feb 21, 2023
Updated the mocks/test repo files configuration to be more
readable/maintainable. Also added `name` properties to `preDeploy`
workflow steps, since using `name` is the easiest and most stable way
of referencing the steps for mocking

See: Expensify#13604
radoslawkrzemien added a commit to radoslawkrzemien/App that referenced this issue Feb 21, 2023
Updated the step mocks to allow for producing outputs that steer the
further workflow execution. Also added run params to the act call

See: Expensify#13604
@melvin-bot melvin-bot bot removed the Overdue label Dec 8, 2023
@dangrous dangrous added Overdue Bug Something is broken. Auto assigns a BugZero manager. labels Dec 8, 2023
Copy link

melvin-bot bot commented Dec 8, 2023

Triggered auto assignment to @muttmuure (Bug), see https://stackoverflow.com/c/expensify/questions/14418 for more details.

@melvin-bot melvin-bot bot removed the Overdue label Dec 8, 2023
Copy link

melvin-bot bot commented Dec 8, 2023

Bug0 Triage Checklist (Main S/O)

  • This "bug" occurs on a supported platform (ensure Platforms in OP are ✅)
  • This bug is not a duplicate report (check E/App issues and #expensify-bugs)
    • If it is, comment with a link to the original report, close the issue and add any novel details to the original issue instead
  • This bug is reproducible using the reproduction steps in the OP. S/O
    • If the reproduction steps are clear and you're unable to reproduce the bug, check with the reporter and QA first, then close the issue.
    • If the reproduction steps aren't clear and you determine the correct steps, please update the OP.
  • This issue is filled out as thoroughly and clearly as possible
    • Pay special attention to the title, results, platforms where the bug occurs, and if the bug happens on staging/production.
  • I have reviewed and subscribed to the linked Slack conversation to ensure Slack/Github stay in sync

@dangrous
Copy link
Contributor

dangrous commented Dec 8, 2023

@melvin-bot melvin-bot bot added the Overdue label Dec 13, 2023
@muttmuure
Copy link
Contributor

@sobitneupane - $500
@rushatgabhane - $500

@melvin-bot melvin-bot bot removed the Overdue label Dec 13, 2023
@muttmuure muttmuure added the External Added to denote the issue can be worked on by a contributor label Dec 13, 2023
@melvin-bot melvin-bot bot changed the title [HOLD for payment 2023-12-06] Local testing of GitHub Actions [$500] [HOLD for payment 2023-12-06] Local testing of GitHub Actions Dec 13, 2023
Copy link

melvin-bot bot commented Dec 13, 2023

Job added to Upwork: https://www.upwork.com/jobs/~016c26e8384c322e36

@melvin-bot melvin-bot bot added the Help Wanted Apply this label when an issue is open to proposals by contributors label Dec 13, 2023
Copy link

melvin-bot bot commented Dec 13, 2023

Triggered auto assignment to Contributor-plus team member for initial proposal review - @ArekChr (External)

@muttmuure muttmuure assigned sobitneupane and unassigned ArekChr Dec 13, 2023
@melvin-bot melvin-bot bot removed the Help Wanted Apply this label when an issue is open to proposals by contributors label Dec 13, 2023
@muttmuure
Copy link
Contributor

muttmuure commented Dec 13, 2023

both should request payment in NewDot - the summary is above here

@sobitneupane
Copy link
Contributor

#13604 (comment)

Requested payment on newDot.

@JmillsExpensify
Copy link

$500 payment approved for @sobitneupane based on this comment.

@JmillsExpensify
Copy link

$500 payment approved for @rushatgabhane based on comment above.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Awaiting Payment Auto-added when associated PR is deployed to production Bug Something is broken. Auto assigns a BugZero manager. Daily KSv2 Engineering External Added to denote the issue can be worked on by a contributor NewFeature Something to build that is a new item. Not a priority
Projects
None yet
Development

No branches or pull requests