-
Notifications
You must be signed in to change notification settings - Fork 1
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
fix: repo url subfolder [IDE-246] #29
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -25,7 +25,9 @@ import ( | |
) | ||
|
||
func GetRepositoryUrl(path string) (string, error) { | ||
repo, err := git.PlainOpen(path) | ||
repo, err := git.PlainOpenWithOptions(path, &git.PlainOpenOptions{ | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Let's make it more complicated. How do we treat git subrepos? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I added a test with what I expected to happen and it passes: 1a10f0e. Could you have a look and see if this matches what you think should happen? |
||
DetectDotGit: true, | ||
}) | ||
if err != nil { | ||
return "", fmt.Errorf("open local repository: %w", err) | ||
} | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
/* | ||
* © 2024 Snyk Limited All rights reserved. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package observability | ||
|
||
import ( | ||
"github.com/rs/zerolog" | ||
) | ||
|
||
type errorReporter struct { | ||
logger *zerolog.Logger | ||
} | ||
|
||
func NewErrorReporter(logger *zerolog.Logger) ErrorReporter { | ||
return &errorReporter{logger} | ||
} | ||
|
||
func (s *errorReporter) FlushErrorReporting() { | ||
} | ||
|
||
func (s *errorReporter) CaptureError(err error, options ErrorReporterOptions) bool { | ||
s.logger.Log().Err(err).Msg("An error has been captured by the error reporter") | ||
return true | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should we have incremental backoff here?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should but I will argue against doing this now because:
snyk-ls
so it has been used to call Deeproxy for a while nowWDYT?