globocom / globocom/huskyCI

Make SecurityTests' timeout configurable

Open
#509 4 comments 0 reactions 0 assignees View on GitHub
feature-request hacktoberfest2022
Dominant language
Go
Stars
595
Forks
135
PR merge metrics
No merged PRs in 30d

Description

## Motivation

We received [this feedback](https://github.com/globocom/huskyCI/issues/407) from huskyCI users (thanks, @igorfernandes 😃) that suggests that the analysis could have a timeout configurable. Some repositories are "very large" take too long to finish, which impacts their CI somehow.

## It would be great if

We add new logic to let developers set this on their side, and not from the hardcoded the API [`config.yaml`](https://github.com/globocom/huskyCI/blob/master/api/config.yaml).

## What we expect

There are a few ways we can take this issue and a start suggestion is to add a new environment variable to the client code, as exemplified below:

```yaml
stages:
- huskyCI

huskyCI:
stage: huskyCI
variables:
HUSKYCI_CLIENT_TESTS_TIMEOUT: 360
script:
- wget $HUSKYCI_CLIENT_URL/huskyci-client
- chmod +x huskyci-client
- ./huskyci-client
```

## Tips

* [This is where the env vars are used by the client](https://github.com/globocom/huskyCI/blob/master/client/config/config.go#L28)
* [This is an example using the command timeout in Gitleaks](https://github.com/globocom/huskyCI/blob/master/api/config.yaml#L324)
* [This is how the API handles the container command](https://github.com/globocom/huskyCI/blob/master/api/util/util.go#L37)

Contributor guide

Open the contributing guide

Research direction

Start with client/config/config.go to inspect how client environment variables are used, then compare the timeout example in api/config.yaml with command handling in api/util/util.go. Trace how SecurityTests currently receives its hardcoded timeout and define the configuration path from the client environment variable. Done means developers can set the timeout in their CI configuration without changing the API config.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
ci-cd, security
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.