Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Jun 2, 2023. It is now read-only.

Queue worker of GolangCI

License

NotificationsYou must be signed in to change notification settings

golangci/golangci-worker

CircleCIGolangCI

Worker

This repository contains code of queue worker. Worker runs golangci-lint and reports result to GitHub.

Development

Technologies

Go (golang), heroku, circleci, docker, redis, postgres.

Preparation

Ingolangci-api repo run:

docker-compose up -d

It runs postgres and redis needed for both api and worker.

How to run worker

make run_dev

How to run once on GitHub repo without changing GitHub data: commit status, comments

REPO={OWNER/NAME} PR={PULL_REQUEST_NUMBER} make test_repo_fake_github

e.g.REPO=golangci/golangci-worker PR=39 make test_repo_fake_github

How to run analysis of pull request locally

# in golangci-api repogodotenv -f .env go run ./scripts/emulate_webhook/main.go -repo golangci/golangci-lint -pr 292 -sha 7b605d5c6f5a524e6b0a9cc12ad747222375ad54

Configuration

Configurate via.env file. Dev.env may be like this:

REDIS_URL="redis://localhost:6379"API_URL="https://api.dev.golangci.com"WEB_ROOT="https://dev.golangci.com"USE_CONTAINER_EXECUTOR_PERCENT=100USE_NEW_REPO_ANALYSIS_PERCENT=100ORCHESTRATOR_ADDR="http://127.0.0.1:8001"ORCHESTRATOR_TOKEN=secret_token

Executors

Executor is an abstration allowing to run arbitrary shell commands.We support following executor types:

  1. shell - runs commands on a local machine
  2. remote shell - runs commands on the specified remote host; it's currently the primary executor
  3. container - runs commands by sending them to containers orchestrator; containers orchestrator runs container for executing commands; currently we migrate to this executor type.

The recommended way to run executors during development:

# in golangci-api repoTOKEN=secret_token go run ./cmd/containers_orchestrator/main.go

API

golangci-api is not needed for running and testing golangci-worker. Not running api can just make log warnings like this:

level=warning msg="Can't get current state: bad status code 404"

Testing

To run tests:

maketest

For more realistic testing thantest_repo_fake_github use in golangci-api repo GitHub WebHook emulator:

go run app/scripts/emulate_webhook/main.go --repo golangci/golangci-worker --pr 39 --sha fbd0d7bada8a6cfa7adbc58e5901e0d66f7f65b1

Contributing

SeeCONTRIBUTING.

About

Queue worker of GolangCI

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors2

  •  
  •  

Languages


[8]ページ先頭

©2009-2025 Movatter.jp