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

Add license headers to files. #511

Merged
merged 2 commits into from
Nov 2, 2020

Conversation

dengliming
Copy link
Contributor

for #484
@jcchavezs Can you help to review these changes?

@eirslett
Copy link
Contributor

Do we really need these license headers, though? I guess it mattered more in the past when Zipkin was a formal Apache Incubator project, but now it's an independent organization that simply chooses to license its software under ASL 2. There's no legal requirement for including license headers, it's more like a recommendation.

At best, including the headers could give some value in theory, but the Apache license is already bundled in the project anyways. The main issue with license headers is that they tend to be forgotten about/unmaintained, and only serve as tech debt.

Anyways, that's my 2c.

@dengliming
Copy link
Contributor Author

@eirslett Thanks for quick reply, you were right. and this PR is just a suggestion.

@anuraaga
Copy link
Contributor

It's pretty common now adays to have license headers so I think it could make sense to have them here too, though no strong feeling about it. But do feel strongly that we can't add license headers without also adding tooling to ensure new files have the license header as part of the build.

@dengliming
Copy link
Contributor Author

dengliming commented Aug 14, 2020

@anuraaga Maybe we can add header rule in tslint.json by using some plugin like license-header(not sure :)? WDYT?

@anuraaga
Copy link
Contributor

Yeah I think that would be fine. Let's hear opinions from other maintainers on their thoughts before adding it :)

@jcchavezs
Copy link
Contributor

jcchavezs commented Aug 31, 2020 via email

@codefromthecrypt
Copy link
Member

My drive by 2p: I agree with @eirslett that it isn't purely needed. If we were to do this, I like using the shortened one-line comments as it reduces the impact on people depending on us. We should also for the sake of sanity think similarly between here and lens (cc @tacigar ) though that isn't required either.

Regardless, the date isn't really correct, usually we get the date range from git, not sure options available, but then this isn't super important.

@petermetz
Copy link
Contributor

any input @adriancole, @petermetz https://github.com/openzipkin/zipkin-js/issues?q=is%3Apr+author%3Apetermetz or @ghermeto? José Carlos Chávez fre. 14. aug. 2020 kl. 05:31 skrev Anuraag Agrawal <[email protected]

: Yeah I think that would be fine. Let's hear opinions from other maintainers on their thoughts before adding it :) — You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub <#511 (comment)>, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAXOYAUW3ARAYOZZNJ3HLKTSASVYDANCNFSM4P6QS25Q .

@jcchavezs
Regarding the question of whether license headers are needed or not in general: I'm indifferent. When it comes to anything related to licensing I always defer to legal experts and only ever do the changes that are deemed mandatory (I do not know if license headers are legally required or not).

I agree with @anuraaga regarding the tooling:
If we do introduce the license headers (which is fine by me) then I would also strongly prefer to have it done in a way that comes with tooling from day one to ensure that human error is not possible and more than that, mistakes are caught early on instead of last minute.
For example if I'm about to submit a PR and forgot to add the header, I would want the build to fail or a pre-commit hook the latest. The bad way of doing it instead would be the very last check failing in the CI environment half an hour after I submitted the PR when I'm most likely already working on something else and (hopefully) am in a flow. (can't remember how long the CI takes, it's just an example).

@jcchavezs
Copy link
Contributor

@dengliming any idea on how address @anuraaga and @petermetz's concern regarding tooling?

@petermetz
Copy link
Contributor

@dengliming any idea on how address @anuraaga and @petermetz's concern regarding tooling?

@jcchavezs I've seen checks like this enforced while sending a PR to webpack recently. Never looked into the details, but if nobody on this thread is aware of any existing tools then I'd start there and just see what they've got and take it from there.
I also understand if nobody has the time to go down rabbit holes and my suggestion just remains a suggestion!

@dengliming
Copy link
Contributor Author

@jcchavezs Sorry for late reply. I haven't thought of a good way yet. @petermetz I'd really appreciate it if you could help. Thanks.

@petermetz
Copy link
Contributor

@petermetz I'd really appreciate it if you could help. Thanks.

@dengliming Don't have the bandwidth right now unfortunately. Apart from the pointers I've given above I have just another link that may help with implementing pre-commit hook checks if that's what you'd want.
And again, I'm not saying any of the things I suggested are must haves, just figured I'd describe what an optimal solution would like from my perspective but I don't mean to insist on any of it since I am not able to help out with the actual work at the moment either. My principle there is that you insist on something being done in a certain way then you have to be ready to put effort into it yourself as well, but I cannot do that right now.

https://codeburst.io/continuous-integration-lint-staged-husky-pre-commit-hook-test-setup-47f8172924fc

Copy link
Contributor

@petermetz petermetz left a comment

Choose a reason for hiding this comment

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

LGTM

Thank you for the pre-commit hook, should make it easier for contributors to avoid having to edit PRs after submitting them.

"radix": ["error", "as-needed"]
},
"radix": ["error", "as-needed"],
"header/header": [2, "line", [{"pattern": " Copyright 2020 The OpenZipkin Authors; licensed to You under the Apache License, Version 2.0."}]]},
Copy link
Member

Choose a reason for hiding this comment

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

how do we want to handle this date.. manually change it? In other projects we are deriving this from git commit info, so that it says like 2016-2020 on file change.

(feel free to merge without addressing this question)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In other projects we are deriving this from git commit info.

That‘s great. and I'm a little confused. Do we really have to keep copyright year and then change it once a year? Personally I suggest we remove copyright Year like other projects. open-telemetry/opentelemetry-java : )

Copy link
Member

Choose a reason for hiding this comment

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

I suspect there's something stronger by saying the year range. However, I'd suggest either do it right or leave it out. I wouldn't necessarily do anything just because otel does though :D

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Thanks for sharing your thought. This is only a suggestion, for reference only. : ).

In other projects we are deriving this from git commit info.

We can try to do this. I know maven plugin can do this (not sure js). It would be better If you can give me a link?

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member

Choose a reason for hiding this comment

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

note if we do this, we need a well commented thing on jobs to do full, not shallow git clone. This is a pitfall of using the git range, as it can be inaccurate if for example, you only get the last 5 commits.

Copy link
Member

@codefromthecrypt codefromthecrypt left a comment

Choose a reason for hiding this comment

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

let's merge this to help avoid rebase land

@dengliming thanks so much and thanks rest for the feedback!

@codefromthecrypt codefromthecrypt merged commit bf7de87 into openzipkin:master Nov 2, 2020
@jcchavezs
Copy link
Contributor

Thanks!

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.

6 participants