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

messages: MessageAckKeyspaceIds #2886

Merged
merged 1 commit into from
May 25, 2017
Merged

messages: MessageAckKeyspaceIds #2886

merged 1 commit into from
May 25, 2017

Conversation

sougou
Copy link
Contributor

@sougou sougou commented May 25, 2017

There is a need for a V2 level API for message acks.

BUG=38423920

@sougou sougou requested a review from alainjobart May 25, 2017 03:42
@sougou
Copy link
Contributor Author

sougou commented May 25, 2017

@michael-berlin I need to override codeclimate for some var names it's flagged. The names are non-compliant because they need to match the proto names. I tried to assert them as WontFix, but it says I'm not authorized.

@michael-berlin
Copy link
Contributor

@michael-berlin I need to override codeclimate for some var names it's flagged. The names are non-compliant because they need to match the proto names. I tried to assert them as WontFix, but it says I'm not authorized.

I think it only complains about the loop variable? You could rename these? ;) Fixing this now (at the price of breaking consistency) would be the easiest solution. This way you also avoid that somebody else runs into this problem at a later point when they touch that code. Note that the golang team doesn't provide directives to exempt something e.g. // NOLINT does not work.

In any case, the Code Climate check is configured as optional (same as with Travis) i.e. you can always override/ignore it. Only the CLA check or the pull approve one require admin rights to ignore it.

@sougou
Copy link
Contributor Author

sougou commented May 25, 2017

I could, but I'd be breaking consistency on how proto names variables. In general, they say that one should not fix golint warnings for golint's sake. Exceptions are allowed where it makes sense.

I can rename these variables, but we'll need a way to override these because there will be cases where it won't make sense to comply.

@michael-berlin
Copy link
Contributor

I could, but I'd be breaking consistency on how proto names variables. In general, they say that one should not fix golint warnings for golint's sake. Exceptions are allowed where it makes sense.

Is this written down somewhere? :) Given that they don't provide a directive to exempt things, I feel like their primary goal is to not have such exceptions in the first place i.e. always write compliant code :)

I can rename these variables, but we'll need a way to override these because there will be cases where it won't make sense to comply.

We can skip the check on a per file basis and do so for generated code: https://github.com/youtube/vitess/blob/master/.codeclimate.yml#L14

For not generated code, I don't want to skip files. Otherwise, we would skip legitimate problems in the same file as well.

@sougou
Copy link
Contributor Author

sougou commented May 25, 2017

Skipping files would not be a good idea. We should just be able to override specific reports (which codeclimate allows, with the right permissions).

The golint documentation specifically states that warnings can be ignored if it doesn't make sense: https://github.com/golang/lint#purpose. And here are some supporting arguments in issues:
golang/lint#89
golang/lint#209

@michael-berlin
Copy link
Contributor

Skipping files would not be a good idea. We should just be able to override specific reports (which codeclimate allows, with the right permissions).

I tried the "Approve" feature in Code Climate and it works for me. Because of my approval, the check is green now.

Did you login with your GitHub account on Code Climate?

I checked the Code Climate settings but didn't find anything which would allow me to configure a list of allowed approvers. My guess is that, similar to Travis, you just need to be a collaborator of the project and then it works? We can follow up with them on that.

Nonetheless, let me repeat what I said earlier:

  • you can ignore the check anyway because it's optional
  • in my personal opinion, you should just rename the local variables to *ID. Everybody knows that golint is picky about ID and would understand if you break the consistency there. IMO that's better than being bothered by this check over and over again. After all, our Git commit hook will nag you about that as well - and that cannot be permanently ignored like Code Climate seems to support. And unlike generated code, we can change the name here and make the warning go away.

Copy link
Contributor

@alainjobart alainjobart left a comment

Choose a reason for hiding this comment

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

One comment on proto file.

// set by the application to further identify the caller.
vtrpc.CallerID caller_id = 1;

// Optional keyspace for message table.
Copy link
Contributor

Choose a reason for hiding this comment

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

The keyspace is not optional in v2, is it?

@sougou
Copy link
Contributor Author

sougou commented May 25, 2017

All review comments addressed including variable renaming.

There is a need for a V2 level API for message acks.

BUG=38423920
@sougou sougou changed the title messages: MessaveAckKeyspaceIds messages: MessageAckKeyspaceIds May 25, 2017
@sougou sougou merged commit 5c3c7c4 into vitessio:master May 25, 2017
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.

4 participants