-
Notifications
You must be signed in to change notification settings - Fork 147
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
feat!: wrap payloads to send to a "method" with "token" or "webhook" #333
Open
zimeg
wants to merge
106
commits into
main
Choose a base branch
from
v2-development
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from 23 commits
Commits
Show all changes
106 commits
Select commit
Hold shift + click to select a range
959992e
feat!: wrap payloads to send to a "method" with "token" or "webhook"
zimeg 82bbd29
docs(fix): remove an extra trailing closing brace
zimeg c8916a0
fix: remove milliseconds from the returned epoch time
zimeg efe707e
feat: log the entire error stack for easier debugs
zimeg c2d4e9c
build: remove compilation steps from the local build
zimeg 1da745b
test(fix): resolve the posted webhook with placeholder values
zimeg 09a1d45
ci: include chat.postMessage and files.uploadV2 in local tests
zimeg b8e82b8
ci: include static checks of code as part of ci
zimeg 962e0db
fix: debug actual response data from the webhook
zimeg dbdbf9f
docs: include a few more words about action outputs
zimeg a10e1f7
fix: use the 'channel' in responses as 'channel_id'
zimeg 9fb3e9e
build(fix): remove removed files from the jsdocs
zimeg 57ab9a4
refactor: parse payload content in a new "content" module
zimeg 6ca6013
style: remove extra spacing from the pull request template
zimeg 5875c61
fix: remove addtional error logging from erroring inputs
zimeg 5b4b7b8
feat: parse action payload inputs as possible yaml values
zimeg ee9e200
docs: update examples and wordings to use the latest changes
zimeg 4c57022
test: update tests in ci to use the yaml inputs
zimeg 72734a9
feat: increase methods for quick use in the local workflow
zimeg 4fa18f2
ci(temp): use the changes of the pull request when running tests
zimeg 32c4ddb
ci: workaround broken biome installations in ci
zimeg 5ffcbc8
ci(fix): remove additional steps for checking test coverage
zimeg 0d8d929
fix: avoid setting setting secrets twice for possible missing values
zimeg e7f7020
docs: reference the complete 'incoming webhooks' feature
zimeg 7f42936
docs: replace the link to repo secrets with another page
zimeg 78e74e6
feat: require a webhook type as part of webhook inputs
zimeg 31b6ed1
feat: open the option to templatize input payloads to action input stβ¦
zimeg 5f3b855
feat: link the outputs of the action to log streams of the webapi
zimeg bc9c18b
fix: link without spacing when creating noop functions
zimeg 8c35f78
ci(fix): use the original message timestamp when threading a message
zimeg b1453da
fix: use a stringified thread ts to avoid float madness
zimeg 518946d
test: templatize the payload file inputs for variable replacements
zimeg 1a77eed
refactor: move tests into a test directory and away from src
zimeg eea2eb1
fix: avoid debug logging undefined data of an undefined response
zimeg 38b6f1e
style: lint fixes that are required for ci to pass
zimeg e3f0238
docs: polish and findings from past readings of the readme
zimeg 7aee130
fix: correct webclient proxy warning to be the https axios agent
zimeg abda089
fix: use the nested message response to gather thread ts
zimeg 6b14b32
test: fail tests that are expected to have thrown but dont
zimeg 23913a6
test: confirm requests are sent with arguments to the slack web api
zimeg 92fd8d8
fix: include the time of action completion when erroring too
zimeg 856cb18
chore: setup a manifest app with workflow and scopes and webhooks
zimeg 3d0eb1e
docs: improve setup instructions with more correct wordings
zimeg 28dee88
ci: revert removal of the build step for packaged distribution
zimeg a9b40ba
build: include the source map in build outputs for error debugs
zimeg 29c7ea6
ci(chore): run check ups of the health score on changes
zimeg 1a8d212
ci(fix): include the include of included paths of check up
zimeg 01ca583
revert(ci): oh oops the error is from codecov setups in this pr
zimeg b88b87a
refactor: rename the testing workflow into a single test file
zimeg 6f23616
refactor: move the local workflow into a development area
zimeg 815c519
style: format json with separate spacing for individual array items
zimeg 8003d03
test: confirm changes match between develop and test and docs
zimeg 19c1ee5
ci: fix inputs that didnt match changes made in the last commit
zimeg ecb8404
ci: fix the path to slack resources to be in slack paths
zimeg 0777d30
ci: fix the gathered thread ts to be from another threaded message
zimeg 574e5f9
test: ensure a file can be uploaded from the action too
zimeg a10a047
style: format the incoming webhook blocks to read inline
zimeg 3abfdb6
style: write emojis at the start of lines for consistency
zimeg 7c719bb
chore: merge wo conflicts in upstream main
zimeg 7165edc
ci: react to with a method before testing incoming message
zimeg 504fb31
fix: use the config input proxy to set the webhook proxy
zimeg 72d552d
test: remove console logs from output when test succeeds
zimeg 9645097
chore: merge w main and the changes to health score
zimeg 84c034a
fix: include proxied https urls with the web client methods
zimeg 67471c1
test: confirm retries happen at expected intervals for the client
zimeg c711234
test: ensure errors happen during invalid config setup
zimeg 4c6260b
fix: templatize payload content from all input sources
zimeg 1b4979e
test: setup the same input before each test before each test
zimeg 48d4ccf
test: match naming of spec its for more reasoning
zimeg 16ea7d7
test: check for replacements of templatized variables
zimeg 05b1c7c
chore: replace hardcoding types with an upstream alternative
zimeg 8618c4d
test: confirm the expected techniques work as expected
zimeg 8066bf9
test: confirm errors are returned when missing webhook inputs
zimeg 103ae85
fix: use the built distribution files when running this action
zimeg be37553
docs: make it clear that the unix epoch is returned in time
zimeg 75d7165
chore: remove additional type roots from past compilation
zimeg bc887ca
build: include the markup-js types as a development depenency
zimeg 90d5d06
style: remove additional undefined chaining after an initial definitoβ¦
zimeg 12e1625
docs(fix): add a step for showing the revealed credetials
zimeg c3a19f3
docs: include complete example links in the ci workflow variable values
zimeg e909226
build: set the node version to match the runner runtime
zimeg a2b32d6
docs(fix): tyypo reminants -> remnants
zimeg 6075734
docs: give the action context for the github context
zimeg 8be2d3a
docs: locate secret values from either outputs or the app settings
zimeg fa91f44
docs: include the requirement of a channel ID where the bot is added
zimeg 540f02d
docs: include an overview of the app found in resources for development
zimeg c21fea2
build: include an example environment variable file for testing
zimeg a8affaa
docs: reference the resources for testing experimental changes in devβ¦
zimeg 2133481
docs(style): wrap lines that exceed the length of the deno fmt
zimeg fd5313b
docs: make wording of step setups more percise
zimeg da7d2a1
docs: revert the changed title to that of the original readme
zimeg 7816a2c
docs(fix): replace a redirected link to contextual workflow info
zimeg ad5d399
temp: print the octokit context in a pull request setting
zimeg a7dc253
docs: fix the context of the default github event payload
zimeg 23838b2
docs: introduce concepts of sending variables with more context
zimeg aab5451
docs: reword the exampliary sentance to reference 'action'
zimeg aceca25
docs(fix): remove the json requirement from input payloads
zimeg b773f12
docs(style): include a few more words for easier reading
zimeg e0e254b
revert "temp: print the octokit context in a pull request setting"
zimeg e37146c
docs: link to outbound resources with more information
zimeg 9df54bb
docs: include more explicit detail on which workflow is updated
zimeg e80e77b
docs: quick link to the sections of different techniques
zimeg 99dd6aa
docs: include information on the reason for deliminating payloads
zimeg ac9a37e
docs(style): change a few words for spacing setups
zimeg f19da83
docs(fix): recommend a templated variable found in the octokit payload
zimeg 9bc0ad9
docs(fix): wrap a numeric float in quotations to make it a string
zimeg File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
{ | ||
"include": ["src/*.js"], | ||
"exclude": ["**/*.spec.js"], | ||
"reporter": ["lcov", "text"], | ||
"all": false, | ||
"cache": true | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
### Summary | ||
### Summary | ||
|
||
Describe the goal of this PR. Mention any related Issue numbers. | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
# Rename this file to .env and update any variables to get started | ||
|
||
SLACK_BOT_TOKEN=xoxb-01010101-abcdefgh | ||
SLACK_CHANNEL_ID=C0123456789 | ||
SLACK_USER_TOKEN=xoxp-22222222-example | ||
SLACK_WEBHOOK_URL=https://hooks.slack.com/services/T0123456789/B0123456789/abcdefghijklmnopqrstuvwxyz |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,25 +1,58 @@ | ||
# Local runs | ||
|
||
For a simple development experience, a local version of this action can be used in experiments. | ||
For a simple development experience, a local version of this action can be used | ||
in experiments: | ||
|
||
```sh | ||
$ npm run local # Test techniques | ||
``` | ||
|
||
**Requirements**: | ||
|
||
- An installation of [nektos/act](https://github.com/nektos/act) | ||
- A running instance of [Docker](https://www.docker.com) | ||
|
||
## Setting up an app | ||
|
||
The saved `local.yml` workflow uses `webhook` and `method` for a combination of | ||
features, which expects the following scopes: | ||
|
||
- `chat:write` | ||
- `files:write` | ||
- `reactions:write` | ||
|
||
## Configuring secrets | ||
These scopes aren't required if the methods used change, but others might be if | ||
different API methods are called! | ||
|
||
To use `${{ secrets.* }}` in the workflow, move `.env.example` to `.env` and update any variables. | ||
This app will have useful variables that can be configured as values in this | ||
next section. | ||
|
||
## Mocking event payloads | ||
## Configuring values | ||
|
||
Different event payloads can be mocked directly with changes to the `event.json` file. | ||
### Changing secrets | ||
|
||
To use `${{ secrets.* }}` in the workflow, move `.env.example` to `.env` and | ||
update any variables. | ||
|
||
### Mocking event payloads | ||
|
||
Different event payloads can be mocked directly with changes to the `event.json` | ||
file. | ||
|
||
Reference: https://docs.github.com/en/webhooks/webhook-events-and-payloads | ||
|
||
## Updating the workflow | ||
|
||
The `local.yml` file contains the workflow used for testing. Updates to these steps can be made to test various functionalities. | ||
The `local.yml` file contains the workflow used for testing. Updates to these | ||
steps can be made to test various functionalities. | ||
|
||
## Running an experiment | ||
|
||
Run the workflow using `npm run local`. The above configurations will be used to simulate an actual workflow run. | ||
Run the workflow using `act` with the `npm run local` script. The above settings | ||
will be used to simulate an actual workflow run: | ||
|
||
```sh | ||
$ npm run local | ||
... | ||
[Local run/run] π Job succeeded | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The concept of a
local
workflow is now moved betweendevelop.yml
and the files in.github/resources
ποΈβπ¨οΈ