Skip to content

Conversation

@severindellsperger
Copy link

I added the lint GitHub action similar to the config-server.
Please review the changes and merge them if they look good to you.

Close #323

Copy link
Contributor

@hansthienpondt hansthienpondt left a comment

Choose a reason for hiding this comment

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

LGTM

@steiler
Copy link
Collaborator

steiler commented Sep 1, 2025

also here why not use the caching package?

@severindellsperger
Copy link
Author

@steiler the setup-go action will try to enable caching.
From setup-go: The action will try to enable caching unless the cache input is explicitly set to false.
Do you see any reason why we want to deactivate it?

@codecov
Copy link

codecov bot commented Jan 15, 2026

Codecov Report

❌ Patch coverage is 21.23288% with 115 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
pkg/datastore/transaction_rpc.go 0.00% 19 Missing ⚠️
pkg/server/datastore.go 0.00% 17 Missing ⚠️
pkg/server/server.go 0.00% 16 Missing ⚠️
pkg/datastore/deviations.go 0.00% 11 Missing ⚠️
pkg/datastore/datastore_rpc.go 0.00% 8 Missing ⚠️
pkg/datastore/types/transaction.go 0.00% 8 Missing ⚠️
pkg/datastore/target/netconf/sync.go 0.00% 4 Missing ⚠️
pkg/tree/root_entry.go 69.23% 3 Missing and 1 partial ⚠️
pkg/tree/types/validation_result.go 0.00% 4 Missing ⚠️
main.go 0.00% 3 Missing ⚠️
... and 15 more

📢 Thoughts on this report? Let us know!

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

defer cancel()
cc, err := grpc.DialContext(ctx, addr,
grpc.WithBlock(),
cc, err := grpc.DialContext(ctx, addr, //nolint:staticcheck
Copy link
Collaborator

Choose a reason for hiding this comment

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

I have added nolint for this deprecated call for now. At the same time I've opened the issue #377 that is about changing this to the NewClient() call.

Copy link
Author

Choose a reason for hiding this comment

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

Alright, works for me.

dialCtx, cancel := context.WithTimeout(ctx, schemaServerConnectRetry)
defer cancel()
cc, err := grpc.DialContext(dialCtx, s.config.SchemaServer.Address, opts...)
cc, err := grpc.DialContext(dialCtx, s.config.SchemaServer.Address, opts...) //nolint:staticcheck
Copy link
Collaborator

Choose a reason for hiding this comment

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

same here, fix deprecated calls later!
#377

Copy link
Author

@severindellsperger severindellsperger left a comment

Choose a reason for hiding this comment

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

I reviewed the changes. Most of it looks good. However, I would check again if the returned errors can be ignored. I prefer a check for the error, or at least a log message, if there was one.

b, err := opts.Marshal(rsp.ConfigTree)
if err != nil {
fmt.Fprintf(os.Stdout, "%v", err)
_, _ = fmt.Fprintf(os.Stdout, "%v", err)
Copy link
Author

Choose a reason for hiding this comment

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

Since you're not using a simple printf, you may want to check the return error of the function at least.

table.Options(tablewriter.WithAlignment(tw.Alignment{tw.AlignLeft}))
table.Bulk(toTableData(rsp))
table.Render()
_ = table.Bulk(toTableData(rsp))
Copy link
Author

Choose a reason for hiding this comment

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

Here again, maybe you want to check the returned error here.

table.Bulk(toTableData(rsp))
table.Render()
_ = table.Bulk(toTableData(rsp))
_ = table.Render()
Copy link
Author

Choose a reason for hiding this comment

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

Same here (error check).

table.Options(tablewriter.WithAlignment(tw.Alignment{tw.AlignLeft}))
table.Bulk(tableData)
table.Render()
_ = table.Bulk(tableData)
Copy link
Author

Choose a reason for hiding this comment

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

Error check

table.Bulk(tableData)
table.Render()
_ = table.Bulk(tableData)
_ = table.Render()
Copy link
Author

Choose a reason for hiding this comment

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

Error check

})

xmlBuilder.AddValue(ctx, &sdcpb.Path{
_ = xmlBuilder.AddValue(ctx, &sdcpb.Path{
Copy link
Author

Choose a reason for hiding this comment

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

AddValue seems to be a pretty difficult function that can return different errors. You may process/log them here.

log := logf.FromContext(ctx).WithName("Get")
ctx = logf.IntoContext(ctx, log)
// log := logf.FromContext(ctx).WithName("Get")
// ctx = logf.IntoContext(ctx, log)
Copy link
Author

Choose a reason for hiding this comment

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

Can those comments be removed?

Copy link
Collaborator

Choose a reason for hiding this comment

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

yes


// Task 1: blocks until cancelled
vp.SubmitFunc(func(ctx context.Context, submit func(Task) error) error {
_ = vp.SubmitFunc(func(ctx context.Context, submit func(Task) error) error {
Copy link
Author

Choose a reason for hiding this comment

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

Consider checking/logging the returned error if there is any.


// Task 2: should run even if cancelled (to decrement inflight)
vp.SubmitFunc(func(ctx context.Context, submit func(Task) error) error {
_ = vp.SubmitFunc(func(ctx context.Context, submit func(Task) error) error {
Copy link
Author

Choose a reason for hiding this comment

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

Consider checking/logging the returned error if there is any.


// stringToDisk just for debugging purpose
func (r *RootEntry) stringToDisk(filename string) error {
func (r *RootEntry) stringToDisk(filename string) error { // nolint:unused
Copy link
Author

Choose a reason for hiding this comment

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

Is there no way to solve this differently so we don't have to mention the unused lint check directive?

Copy link
Collaborator

Choose a reason for hiding this comment

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

you can chnage it to an uppercase Function, but then it is a public function ... and this is really only used by me I guess in debugging to write the tree to a file to be able to inspect it ... because of the limitations that vars are only displayed to a certain length bla bla

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.

Add Lint Action

3 participants