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

PMM-7 update license to Apache 2.0 #679

Merged
merged 5 commits into from
Jun 29, 2023
Merged

Conversation

BupycHuk
Copy link
Member

Fixes #578

  • Links to other linked pull requests (optional).

  • Tests passed.
  • Fix conflicts with target branch.
  • Update jira ticket description if needed.
  • Attach screenshots/console output to confirm new behavior to jira ticket, if applicable.

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.

@BupycHuk BupycHuk requested a review from a team as a code owner June 29, 2023 08:47
@BupycHuk BupycHuk requested review from ademidoff and JiriCtvrtka and removed request for a team June 29, 2023 08:47
@ademidoff
Copy link
Member

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)

@BupycHuk BupycHuk requested a review from ademidoff June 29, 2023 09:08
@ademidoff
Copy link
Member

I believe we should remove the references to old GH actions in the settings, they will never run :)

Screenshot 2023-06-29 at 12 11 48

Copy link

@github-actions github-actions bot left a 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)

internal/util/util.go Show resolved Hide resolved
internal/util/util.go Show resolved Hide resolved
StorageEngine StorageEngine
}

// Struct for replSetGetStatus

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

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 {

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 {

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)


type StorageEngine struct {
Name string `bson:"name"`
SupportCommittedReads bool `bson:supportsCommittedReads"`

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

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

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.

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

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

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{
Copy link
Contributor

Choose a reason for hiding this comment

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

Leftover?

Copy link
Member Author

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.

@BupycHuk BupycHuk merged commit 6eedce7 into main Jun 29, 2023
8 checks passed
@BupycHuk BupycHuk deleted the PMM-7-update-license-apache branch June 29, 2023 11:51
adnull pushed a commit to adnull/mongodb_exporter_mt that referenced this pull request Jul 6, 2023
* 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
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.

License Inconsistency in code files
4 participants