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

feat: add server mode #12

Merged
merged 11 commits into from
May 9, 2024
Merged

feat: add server mode #12

merged 11 commits into from
May 9, 2024

Conversation

jippi
Copy link
Owner

@jippi jippi commented May 8, 2024

Work

  • Implement webhook endpoint
  • Configure project/group/global level webhook targeting /gitlab endpoint
  • Supports Comments (note event)
  • Supports Merge request events (merge_request event)
  • Add webhook_event Expr variable value with the full raw event payload sent from the GitLab server. (NULL in non-server mode)

Why

Deploy a single instance of scm-engine, with a single privileged account/token, and configure webhook at the level you want. Any project can start to use scm-engine by simply putting an scm-engine.yml file in the location configured on the server (default: /.scm-engine.yml)

No additional overhead, security, or compliance considerations.

Workflow

  1. Does a partial decode of the payload to extract details needed
    • project.path_with_namespace
    • merge_request.iid (project level id for the MR)
    • merge_request.last_commit.id (git SHA)
  2. Tries to grab the $SCM_ENGINE_CONFIG_FILE (-config-file) from the repo over HTTP API
  3. Parses config file
  4. Processes the config file

@jippi jippi self-assigned this May 8, 2024
@codecov-commenter
Copy link

codecov-commenter commented May 8, 2024

Codecov Report

Attention: Patch coverage is 0% with 507 lines in your changes are missing coverage. Please review.

Project coverage is 0.00%. Comparing base (ca1bb19) to head (532eb2c).
Report is 12 commits behind head on main.

Files Patch % Lines
pkg/tui/printer.go 0.00% 125 Missing ⚠️
cmd/cmd_server.go 0.00% 92 Missing ⚠️
pkg/tui/logger.go 0.00% 53 Missing ⚠️
pkg/tui/style.go 0.00% 52 Missing ⚠️
pkg/tui/theme.go 0.00% 33 Missing ⚠️
pkg/tui/context.go 0.00% 32 Missing ⚠️
main.go 0.00% 25 Missing ⚠️
pkg/tui/writer.go 0.00% 23 Missing ⚠️
pkg/tui/helpers.go 0.00% 20 Missing ⚠️
cmd/shared.go 0.00% 14 Missing ⚠️
... and 7 more
Additional details and impacted files
@@          Coverage Diff           @@
##            main     #12    +/-   ##
======================================
  Coverage   0.00%   0.00%            
======================================
  Files         20      30    +10     
  Lines        730    1405   +675     
======================================
- Misses       730    1405   +675     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@jippi jippi force-pushed the implement-server-ref branch from 451a864 to c6f7f12 Compare May 9, 2024 12:23
@jippi jippi force-pushed the implement-server-ref branch 7 times, most recently from 383a1ea to 94e534e Compare May 9, 2024 13:01
@jippi jippi force-pushed the implement-server-ref branch from 94e534e to 532eb2c Compare May 9, 2024 13:03
@jippi jippi merged commit 46821ec into main May 9, 2024
11 checks passed
@jippi jippi deleted the implement-server-ref branch May 9, 2024 13:05
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