-
Notifications
You must be signed in to change notification settings - Fork 424
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
PMM-7 update license to Apache 2.0 #679
Conversation
I believe the code needs to be formatted to make the pipelines pass (ex https://github.com/percona/mongodb_exporter/actions/runs/5410267787/jobs/9831480503?pr=679) |
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.
Remaining comments which cannot be posted as a review comment to avoid GitHub Rate Limit
golangci-lint
internal/util/util.go|39 col 13| error returned from external package is unwrapped: sig: func (*go.mongodb.org/mongo-driver/mongo.SingleResult).Decode(v interface{}) error (wrapcheck)
internal/util/util.go|48 col 15| error returned from external package is unwrapped: sig: func (*go.mongodb.org/mongo-driver/mongo.SingleResult).Decode(v interface{}) error (wrapcheck)
StorageEngine StorageEngine | ||
} | ||
|
||
// Struct for replSetGetStatus |
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.
🚫 [golangci-lint] reported by reviewdog 🐶
Comment should end in a period (godot)
ConfigsvrConnectionString string `bson:"configsvrConnectionString"` | ||
} | ||
|
||
// MyState is a subset of getDiagnosticData result used to tag metrics in the MongoDB exporter |
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.
🚫 [golangci-lint] reported by reviewdog 🐶
Comment should end in a period (godot)
"go.mongodb.org/mongo-driver/bson/primitive" | ||
) | ||
|
||
type Optime struct { |
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.
🚫 [golangci-lint] reported by reviewdog 🐶
exported: exported type Optime should have comment or be unexported (revive)
if e, ok := err.(mongo.CommandError); ok && IsReplicationNotEnabledError(e) { | ||
return "", nil | ||
} | ||
if _, ok := err.(topology.ServerSelectionError); ok { |
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.
🚫 [golangci-lint] reported by reviewdog 🐶
type assertion on error will fail on wrapped errors. Use errors.As to check for specific errors (errorlint)
internal/proto/replstatus.go
Outdated
|
||
type StorageEngine struct { | ||
Name string `bson:"name"` | ||
SupportCommittedReads bool `bson:supportsCommittedReads"` |
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.
🚫 [golangci-lint] reported by reviewdog 🐶
structtag: struct field tag bson:supportsCommittedReads"
not compatible with reflect.StructTag.Get: bad syntax for struct tag value (govet)
if _, ok := err.(topology.ServerSelectionError); ok { | ||
return "", nil | ||
} | ||
return "", err |
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.
🚫 [golangci-lint] reported by reviewdog 🐶
return with no blank line before (nlreturn)
// See the License for the specific language governing permissions and | ||
// limitations under the License. | ||
|
||
package proto |
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.
🚫 [golangci-lint] reported by reviewdog 🐶
ST1000: at least one file in a package should have a package comment (stylecheck)
) | ||
|
||
type Optime struct { | ||
Ts primitive.Timestamp `bson:"ts"` // The Timestamp of the last operation applied to this member of the replica set from the oplog. |
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.
🚫 [golangci-lint] reported by reviewdog 🐶
ST1003: struct field Ts should be TS (stylecheck)
|
||
err := client.Database("admin").RunCommand(ctx, bson.M{"getDiagnosticData": 1}).Decode(&ms) | ||
if err != nil { | ||
return 0, err |
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.
🚫 [golangci-lint] reported by reviewdog 🐶
error returned from external package is unwrapped: sig: func (*go.mongodb.org/mongo-driver/mongo.SingleResult).Decode(v interface{}) error (wrapcheck)
func ReplicasetConfig(ctx context.Context, client *mongo.Client) (*proto.ReplicasetConfig, error) { | ||
var rs proto.ReplicasetConfig | ||
if err := client.Database("admin").RunCommand(ctx, bson.M{"replSetGetConfig": 1}).Decode(&rs); err != nil { | ||
return nil, err |
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.
🚫 [golangci-lint] reported by reviewdog 🐶
error returned from external package is unwrapped: sig: func (*go.mongodb.org/mongo-driver/mongo.SingleResult).Decode(v interface{}) error (wrapcheck)
"mongodb_top_update_count", | ||
} | ||
filter = nil | ||
//filter := []string{ |
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.
Leftover?
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 have no idea what happened there, so I decided to leave it as a comment to make linters not complain about that.
* PMM-7 update license to Apache 2.0 * PMM-7 Fix format * PMM-7 Fix license checker * PMM-7 Fix linters * PMM-7 revert Go version update and fix some linters
Fixes #578
Once all checks pass and the code is ready for review, please add
pmm-review-exporters
team as the reviewer. That would assign people from the review team automatically. Report any issues on our Forum.