Skip to content

Conversation

@nakabonne
Copy link
Member

What this PR does / why we need it:
This PR solves the problem where Piped would specify a local absolute path as GitPath when reporting a Git-defined Config to Control-plane.

Which issue(s) this PR fixes:

Close #2806

Does this PR introduce a user-facing change?:

NONE

@pipecd-bot
Copy link
Collaborator

DOCKER

Unabled to get changed files of pull request.

Details
Error: rpc error: code = NotFound desc = not found

@pipecd-bot
Copy link
Collaborator

COVERAGE

Code coverage for golang is 31.99%. This pull request increases coverage by 0.00%.

File Function Base Head Diff
pkg/app/piped/appconfigreporter/appconfigreporter.go Reporter.findRegisteredApps 90.00% 90.48% +0.48%
pkg/app/piped/appconfigreporter/appconfigreporter.go Reporter.readApplicationInfo 76.92% 75.00% -1.92%


func (r *Reporter) readApplicationInfo(ctx context.Context, cfgFilePath string) (*model.ApplicationInfo, error) {
b, err := fs.ReadFile(r.fileSystem, cfgFilePath)
func (r *Reporter) readApplicationInfo(appPath, cfgFileAbsPath string) (*model.ApplicationInfo, error) {
Copy link
Member

Choose a reason for hiding this comment

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

Or appDirPath, cfgFileRelPath

Copy link
Member

@nghialv nghialv Nov 19, 2021

Choose a reason for hiding this comment

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

Sorry, it should be repoDir, appDirRelPath, cfgFilename

Copy link
Member

Choose a reason for hiding this comment

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

I mean we should use the same thing in our code and data in db, they are appPath and cfgFilename, and repoDir is added for dealing with the local file system.

@nakabonne
Copy link
Member Author

@nghialv Applied! PTAL

@nghialv
Copy link
Member

nghialv commented Nov 19, 2021

Looks nice.
/lgtm

@pipecd-bot
Copy link
Collaborator

COVERAGE

Code coverage for golang is 31.98%. This pull request decreases coverage by -0.00%.

File Function Base Head Diff
pkg/app/piped/appconfigreporter/appconfigreporter.go Reporter.readApplicationInfo 76.92% 75.00% -1.92%

@khanhtc1202
Copy link
Member

Nice
/approve

@pipecd-bot
Copy link
Collaborator

APPROVE

This pull request is APPROVED by khanhtc1202.

Approvers can cancel the approval by writing /approve cancel in a comment. Any additional commits also will change this pull request to be not-approved.

@pipecd-bot pipecd-bot merged commit 6b6bf58 into master Nov 19, 2021
@pipecd-bot pipecd-bot deleted the fix-app-cfg-path branch November 19, 2021 08:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Return an error if any one of required field of Application is empty

5 participants