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: copy linter binary to container #325

Merged
merged 2 commits into from
Sep 6, 2024

Conversation

wwcchh0123
Copy link
Contributor

No description provided.

Copy link

netlify bot commented Sep 4, 2024

Deploy Preview for reviewbot-x canceled.

Name Link
🔨 Latest commit e960ca0
🔍 Latest deploy log https://app.netlify.com/sites/reviewbot-x/deploys/66daa75df7e82a0008891b0d

@wwcchh0123 wwcchh0123 force-pushed the feat/copylinter branch 4 times, most recently from 4cb2f5d to 06ceb89 Compare September 5, 2024 12:18
Copy link

codecov bot commented Sep 5, 2024

Codecov Report

Attention: Patch coverage is 28.57143% with 20 lines in your changes missing coverage. Please review.

Project coverage is 37.20%. Comparing base (60cdf05) to head (e960ca0).
Report is 3 commits behind head on master.

Files with missing lines Patch % Lines
internal/runner/docker.go 43.75% 4 Missing and 5 partials ⚠️
server.go 0.00% 7 Missing ⚠️
config/config.go 20.00% 2 Missing and 2 partials ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #325      +/-   ##
==========================================
- Coverage   37.24%   37.20%   -0.04%     
==========================================
  Files          27       27              
  Lines        1995     2013      +18     
==========================================
+ Hits          743      749       +6     
- Misses       1157     1165       +8     
- Partials       95       99       +4     

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

config/config.go Outdated
@@ -38,13 +38,23 @@ type GlobalConfig struct {
JavaStyleCheckRuleConfig string `json:"javastylecheckruleConfig,omitempty"`
}

type LogStorageConfig struct {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

没用到的先删掉

config/config.go Outdated
CustomRemoteConfigs map[string]any `json:"customRemoteConfigs"`
}

type GithubConfig struct{}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

同上

config/config.go Outdated
type GithubConfig struct{}

type DockerAsRunner struct {
Image string `json:"image,omitempty"`
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

DockerAsRunner 配置若存在,Image这里是不是应该必须要有?

log.Infof("container created: %v", resp.ID)

if cfg.DockerAsRunner.CopyLinterFromOrigin {
cmd := exec.Command("which", lintername)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

linterOrignPath = string(cmdOutput[:len(cmdOutput)-1])
}
if err != nil {
log.Errorf("failed to find %s :%v", lintername, err)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

error 为何都不return呢?

@@ -46,7 +46,7 @@ func (l *LocalRunner) Prepare(ctx context.Context, cfg *config.Linter) error {
return nil
}

func (l *LocalRunner) Run(ctx context.Context, cfg *config.Linter) (io.ReadCloser, error) {
func (l *LocalRunner) Run(ctx context.Context, cfg *config.Linter, lintername string) (io.ReadCloser, error) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

config.Linter 还是增加个属性Name,来做这个事情
Agent.LinterName 可以相应的删掉

@wwcchh0123 wwcchh0123 force-pushed the feat/copylinter branch 7 times, most recently from 334a819 to 47997eb Compare September 6, 2024 06:51
@CarlJi CarlJi merged commit 84dee13 into qiniu:master Sep 6, 2024
6 of 7 checks passed
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