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

Reimplement the action based on godo and make it more orchestratable #114

Merged
merged 10 commits into from
Jul 31, 2024

Conversation

markusthoemmes
Copy link
Contributor

This is a complete rewrite with the goal of being more orchestratable in a broader GitHub Actions context.

Breaking changes:

  • The images input is no longer supported. Instead, use env-var-substitution for an in-repository app spec or the IMAGE_DIGEST_$component-name/IMAGE_TAG_$component-name environment variables to change the respective fields of images in an existing app.

@markusthoemmes markusthoemmes force-pushed the v2 branch 2 times, most recently from 6703300 to b1e377d Compare July 30, 2024 07:51
@markusthoemmes markusthoemmes force-pushed the v2 branch 3 times, most recently from fd7104c to 3a4c56d Compare July 30, 2024 09:12
README.md Outdated Show resolved Hide resolved
This is a complete rewrite with the goal of being more orchestratable in a broader GitHub Actions context.

- Rewritten to use `godo` instead of shelling out to `doctl` for better error handling and overall control of the process. Fixes #112. Fixes #113.
- Supports picking up an in-repository (or filesystem really) `app.yaml` (defaults to `.do/app.yaml`, configurable via the `app_spec_location` input) to create the app from instead of having to rely on an already existing app that's then downloaded (though that is still supported). The in-filesystem app spec can also be templated with environment variables automatically (see examples below). Fixes #106.
- Prints the build and deploy logs into the Github Action log (configurable via `print_build_logs` and `print_deploy_logs`) and surfaces them as outputs `build_logs` and `deploy_logs`. Fixes #73.
- Provides the app's metadata as the output `app`. Fixes #92.

**Breaking changes:**

- The `images` input is no longer supported. Instead, use env-var-substitution for an in-repository app spec or the `IMAGE_DIGEST_$component-name`/`IMAGE_TAG_$component-name` environment variables to change the respective fields of images in an existing app.
@github-actions github-actions bot added documentation Improvements or additions to documentation enhancement New feature or request maintenance labels Jul 30, 2024
Copy link

@greeshmapill greeshmapill left a comment

Choose a reason for hiding this comment

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

Few nits..

README.md Outdated Show resolved Hide resolved
README.md Outdated Show resolved Hide resolved
deploy/main.go Outdated Show resolved Hide resolved
deploy/main.go Outdated Show resolved Hide resolved
LICENSE Outdated Show resolved Hide resolved
@@ -47,9 +47,10 @@ autolabeler:
- "**/*.md"
- label: "enhancement"
Copy link
Contributor

Choose a reason for hiding this comment

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

not sure *.go should be an enhancement.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Since this was sitting on internal/**/* I figured I'd keep that semantic by making any Golang change an enhancement. I'm not too fuzzed about this anyway though.

Got an alternative proposal?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I went and dropped the filter. I guess PRs should be manually labeled to be enhancement vs. bug fix.

@@ -29,7 +29,8 @@ func main() {
a.Fatalf("failed to get GitHub context: %v", err)
}

do := godo.NewFromToken(in.token).Apps
do := godo.NewFromToken(in.token)
do.UserAgent = "do-app-action-delete"
Copy link
Contributor

Choose a reason for hiding this comment

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

is there a way to add a version of the action here?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Getting the proper version might be tricky, outside of manually updating it. I'll try to see if we can get the commit SHA added easily though.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Tried for a bit and it seems like the action isn't checked out as a git repository. There's an action_ref field on the Github context that contains the reference the user used to fetch the action but that also feel kinda meh tbh.

The most reliable way would likely be to hardcode and keep updating it, though I also don't love that 😓 . I'll move forward as-is though, we can enhance this further down the line as we see fit.

@markusthoemmes markusthoemmes force-pushed the v2 branch 2 times, most recently from fb00d03 to ee8e544 Compare July 31, 2024 08:38
@markusthoemmes markusthoemmes merged commit 4ccabc6 into main Jul 31, 2024
7 checks passed
@markusthoemmes markusthoemmes deleted the v2 branch July 31, 2024 09:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation enhancement New feature or request maintenance
Projects
None yet
5 participants