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

Testing Farm as Git Hub Action - Typescript version 🚜 #84

Merged
merged 8 commits into from
Nov 27, 2023
Merged

Testing Farm as Git Hub Action - Typescript version 🚜 #84

merged 8 commits into from
Nov 27, 2023

Conversation

jamacku
Copy link
Member

@jamacku jamacku commented Nov 15, 2023

This PR aims to reimplement the current Action in a language that will allow easier extendability and testability than the current composite yaml/python/bash implementation.

I chose TypeScript because it's the language Git Hub uses to write the official Actions. There are a lot of libraries that make writing GitHub Actions easier than in other languages.

This PR is keeping the current behavior/inputs/outputs except:

Notes from going through the current implementation:

  • input pr_head_sha - is this useful/needed?
  • outputs - are they used outside of the tfaga Action?

TODO:

  • Tests
  • Documentation updates, if needed
  • Manual testing of all potential scenarios/ configurations
  • Review

Suggestions

@github-advanced-security
Copy link

This pull request sets up GitHub code scanning for this repository. Once the scans have completed and the checks have passed, the analysis results for this pull request branch will appear on this overview. Once you merge this pull request, the 'Security' tab will show more code scanning analysis results (for example, for the default branch). Depending on your configuration and choice of analysis tool, future pull requests will be annotated with code scanning analysis results. For more information about GitHub code scanning, check out the documentation.

@zmiklank zmiklank self-requested a review November 15, 2023 15:46
@codecov-commenter
Copy link

Welcome to Codecov 🎉

Once merged to your default branch, Codecov will compare your coverage reports and display the results in this comment.

Thanks for integrating Codecov - We've got you covered ☂️

src/action.ts Show resolved Hide resolved
@zmiklank
Copy link
Collaborator

Action items for zmiklank - look at how pr_head_sha is used in current action.

@jamacku jamacku changed the base branch from main to typescript November 16, 2023 12:16
action.yml Outdated Show resolved Hide resolved
This PR aims to reimplement the current Action in a language that will
allow easier extendability and testability than the current
composite yaml/python/bash implementation.

This PR is keeping the current behavior/inputs/outputs except:

- input debug - removed - we should use the native version of running Actions in debug mode
  - https://docs.github.com/en/actions/monitoring-and-troubleshooting-workflows/enabling-debug-logging
@zmiklank
Copy link
Collaborator

Action items for zmiklank - look at how pr_head_sha is used in current action.

So it is used only when using this action to test a PR. Only used to obtain sha of the latest commit in PR. If this can be obtained in some more straightforward way then we do not need this.
Please note, that the testing-farm-as-a-github-action needs to know this SHA without need to cloning the tested repo directly in the GitHub action because for most use-cases is sufficient to clone the tested repo on the TF machine.

Also, if we want to remove this input, even though it seems like non-breaking change, I would consider to release it as tfaga v3.

TODO for @zmiklank: to create needed changes in tfaga-wrapper as discussed in person.

@zmiklank
Copy link
Collaborator

The 'typescript' branch in tfaga-wrapper was created. I also created draft PR for nginx that moves nginx testing to this typescript-written tfaga once this PR is merged to 'typescript' branch.

@jamacku jamacku marked this pull request as ready for review November 21, 2023 12:37
@jamacku
Copy link
Member Author

jamacku commented Nov 21, 2023

@zmiklank, @phracek, I think it's ready for review.

@jamacku jamacku changed the title [WIP]: Testing Farm as Git Hub Action - Typescript version 🚜 Testing Farm as Git Hub Action - Typescript version 🚜 Nov 21, 2023
.github/workflows/codeql-analysis.yml Outdated Show resolved Hide resolved
action.yml Show resolved Hide resolved
action.yml Show resolved Hide resolved
src/main.ts Show resolved Hide resolved
@jamacku
Copy link
Member Author

jamacku commented Nov 23, 2023

@phracek, I have added a DEVELOPMENT.md document. It should help you and others get started with Typescript and GitHub Actions.

@phracek
Copy link
Member

phracek commented Nov 27, 2023

@jamacku I see there is checkbox called Manual testing of all potential scenarios/ configurations. What does it mean?

@jamacku
Copy link
Member Author

jamacku commented Nov 27, 2023

@phracek, It was just a note for me to try to test it "manually" using my fork of nginx-container, but I think the best would be to test it directly in nginx-container upstream.

I did some basic tests and the basics work.

@jamacku jamacku requested a review from phracek November 27, 2023 11:41
Copy link
Member

@phracek phracek left a comment

Choose a reason for hiding this comment

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

I would prefer to merge it to typescript branch and start with testing on real container. Let's fix problems in typescript branch in real life.

@phracek phracek merged commit a462b66 into sclorg:typescript Nov 27, 2023
5 checks passed
@jamacku jamacku deleted the typescript branch November 27, 2023 12:11
zmiklank pushed a commit that referenced this pull request Jan 18, 2024
* Testing Farm as Git Hub Action - Typescript version

This PR aims to reimplement the current Action in a language that will
allow easier extendability and testability than the current
composite yaml/python/bash implementation.

This PR is keeping the current behavior/inputs/outputs except:

- input debug - removed - we should use the native version of running Actions in debug mode
  - https://docs.github.com/en/actions/monitoring-and-troubleshooting-workflows/enabling-debug-logging

* doc: update format of USAGE.md

* Basic integration test

* fix: apply the requested changes

* remove makefile, no longer in use

* doc: More documentation

* doc: Add `DEVELOPMENT` document

* ci: drop schedule for codeql analysis
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.

None yet

4 participants