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

[DDO-3289] Deploy Hook test mechanism #349

Merged
merged 4 commits into from
Nov 3, 2023

Conversation

jack-r-warren
Copy link
Contributor

Adds endpoints to manually trigger deploy hooks. This is really just intended for test purposes, though I recognize that it could be misused. The endpoints require a minimal JSON body as protection against CSRF.

Testing

Mocked both Slack and GitHub to do this. Took quite a bit longer than writing the actual API endpoints, might not've bothered if I'd known it was going to take that long. Whatever, done now.

Risk

Extremely low

@jack-r-warren jack-r-warren requested a review from a team as a code owner November 2, 2023 22:16
Copy link

sonarqubecloud bot commented Nov 2, 2023

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 13 Code Smells

No Coverage information No Coverage information
10.7% 10.7% Duplication

Copy link

github-actions bot commented Nov 2, 2023

What's New


POST /api/deploy-hooks/github-actions/procedures/v3/test/{selector}

Test a GithubActionsDeployHook

POST /api/deploy-hooks/slack/procedures/v3/test/{selector}

Test a SlackDeployHook

Copy link

codecov bot commented Nov 2, 2023

Codecov Report

Merging #349 (d309140) into main (82aeff1) will increase coverage by 0.12%.
Report is 1 commits behind head on main.
The diff coverage is 76.63%.

@@            Coverage Diff             @@
##             main     #349      +/-   ##
==========================================
+ Coverage   65.48%   65.60%   +0.12%     
==========================================
  Files         149      151       +2     
  Lines        8749     8853     +104     
==========================================
+ Hits         5729     5808      +79     
- Misses       2619     2636      +17     
- Partials      401      409       +8     
Files Coverage Δ
...ock/internal/api/sherlock/chart_version_v3_edit.go 63.33% <ø> (ø)
sherlock/internal/api/sherlock/routes.go 100.00% <100.00%> (ø)
sherlock/internal/models/user.go 90.76% <100.00%> (+1.29%) ⬆️
sherlock/internal/slack/send_message.go 100.00% <100.00%> (ø)
...nal/api/sherlock/slack_deploy_hooks_v3_test_run.go 74.35% <74.35%> (ø)
...herlock/github_actions_deploy_hooks_v3_test_run.go 70.58% <70.58%> (ø)

Copy link

github-actions bot commented Nov 2, 2023

Published image from d309140 (merge 68bbac1):

us-central1-docker.pkg.dev/dsp-artifact-registry/sherlock/sherlock:v0.2.31-68bbac1

@jack-r-warren jack-r-warren merged commit 3767478 into main Nov 3, 2023
15 checks passed
@jack-r-warren jack-r-warren deleted the DDO-3289-deploy-hook-test-runs branch November 3, 2023 15:36
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.

2 participants