You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@skywalking.apache.org by GitBox <gi...@apache.org> on 2023/01/01 04:54:52 UTC

[GitHub] [skywalking] tisonkun opened a new issue, #10223: [Bug] skyWalking-eyes checks header should not require to match this year

tisonkun opened a new issue, #10223:
URL: https://github.com/apache/skywalking/issues/10223

   ### Search before asking
   
   - [X] I had searched in the [issues](https://github.com/apache/skywalking/issues?q=is%3Aissue) and found no similar issues.
   
   
   ### Apache SkyWalking Component
   
   License Tools (apache/skywalking-eyes)
   
   ### What happened
   
   Now we're in 2023 and it exposes a bug in the skywalking eyes header checks for license that have a `year` placeholder: https://github.com/korandoru/zeronos/actions/runs/3815180690/jobs/6490013554
   
   After running the fix step locally, I notice that it's because the tool require the `year` placeholder to be resolved as "this year":
   
   ```go
   func (config *ConfigHeader) GetLicenseContent() (c string) {
   	owner, name := config.License.CopyrightOwner, config.License.SoftwareName
   
   	defer func() {
   		c = strings.ReplaceAll(c, "[year]", strconv.Itoa(time.Now().Year()))
   		c = strings.ReplaceAll(c, "[owner]", owner)
   		c = strings.ReplaceAll(c, "[software-name]", name)
   	}()
   
   	if c = strings.TrimSpace(config.License.Content); c != "" {
   		return config.License.Content // Do not change anything in user config
   	}
   	c, err := readLicenseFromSpdx(config)
   	if err != nil {
   		logger.Log.Warnln(err)
   		return ""
   	}
   
   	return c
   }
   ```
   
   ### What you expected to happen
   
   Check succeeds. Because we should be able to accept license headers to replace the `[year]` with inceptionYear that <= this year.
   
   ### How to reproduce
   
   See the CI report above. I think all projects using skywalking eyes with license that has a `year` placeholder will report more cases later.
   
   ### Anything else
   
   [license-maven-plugin](https://github.com/mathieucarbou/license-maven-plugin) provides a series of year predefines:
   
   * `license.git.copyrightLastYear` - the year of the last change of the present file as seen in git history
   * `license.git.copyrightYears` - the combination of `project.inceptionYear` and `license.git.copyrightLastYear` delimited by a dash (`-`), or just `project.inceptionYear` if `project.inceptionYear` is equal to `license.git.copyrightLastYear`
   * `license.git.CreationAuthorName` and `license.git.CreationAuthorEmail` - the name and email of the author of the first commit of the present file as seen in git history.
   * `license.git.copyrightCreationYear` - the year of the first commit of the present file as seen in git history
   * `license.git.copyrightExistenceYears` - Similar to `license.git.copyrightYears` but using `license.git.copyrightCreationYear` for the first year
   
   This can be an alternative before license-eye fixes the issue. Or users can update the year to this year.
   
   ### Are you willing to submit PR?
   
   - [ ] Yes I am willing to submit a PR!
   
   ### Code of Conduct
   
   - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [skywalking] kezhenxu94 commented on issue #10223: [Bug] skyWalking-eyes checks header should not require to match this year

Posted by GitBox <gi...@apache.org>.
kezhenxu94 commented on issue #10223:
URL: https://github.com/apache/skywalking/issues/10223#issuecomment-1376748085

   Added a configuration `copyright-year` to allow setting a fixed year instead of matching the current year.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [skywalking] wu-sheng commented on issue #10223: [Bug] skyWalking-eyes checks header should not require to match this year

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on issue #10223:
URL: https://github.com/apache/skywalking/issues/10223#issuecomment-1368367686

   Let's wait for @kezhenxu94 to explain the design. He is still recovering.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [skywalking] wu-sheng commented on issue #10223: [Bug] skyWalking-eyes checks header should not require to match this year

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on issue #10223:
URL: https://github.com/apache/skywalking/issues/10223#issuecomment-1369395213

   One background, the website footer(another kind of publication)is required to keep year up to date.
   
   Whether the publication is a kind of distribution, or vice verse?
   
   Generally, this could be a feature if the maintainer of the repository decides not to update. I can't see it harms anyone. 
   Meanwhile, we are better to have a solid resolution to recommend as the default.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [skywalking] kezhenxu94 commented on issue #10223: [Bug] skyWalking-eyes checks header should not require to match this year

Posted by GitBox <gi...@apache.org>.
kezhenxu94 commented on issue #10223:
URL: https://github.com/apache/skywalking/issues/10223#issuecomment-1369341010

   I personally think the users should update the year in license every year, checking the year according to something like git modification time doesn't make much sense to me.
   
   But if for any reason the license is not applicable to the work since a year, say 2020, I agree we can have a configuration  similar to `copyright-owner`, let's call it `copyright-years` for now and users should set `copyright-years` to the fixed year(range).
   
   In short, my thought is: if the license is still applicable to the work, the year should be updated annually


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [skywalking] kezhenxu94 commented on issue #10223: [Bug] skyWalking-eyes checks header should not require to match this year

Posted by GitBox <gi...@apache.org>.
kezhenxu94 commented on issue #10223:
URL: https://github.com/apache/skywalking/issues/10223#issuecomment-1369369094

   > While in another aspect that `header fix` will add a brand new header instead of modifying in place, which make the "update annually" quick complex to do (UPDATE: Global find-and-replace in editor can help). But it should be another issue.
   
   Yes agree. That deserves a fix to the `header fix` command. 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [skywalking] wu-sheng commented on issue #10223: [Bug] skyWalking-eyes checks header should not require to match this year

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on issue #10223:
URL: https://github.com/apache/skywalking/issues/10223#issuecomment-1368366480

   What is your proposal to change? Adding a new variable to represent a year range? 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [skywalking] tisonkun commented on issue #10223: [Bug] skyWalking-eyes checks header should not require to match this year

Posted by GitBox <gi...@apache.org>.
tisonkun commented on issue #10223:
URL: https://github.com/apache/skywalking/issues/10223#issuecomment-1369393730

   > Additionally, from an engineer's perspective, I don't want to update the licenses of **all** files once a year. It's tedious and stupid as well.
   
   Agree. Maybe you can file an issue on https://issues.apache.org/jira/projects/LEGAL. Although software under the ASF uses a different header that doesn't have a copyright line, it's still an issue with Apache License 2.0 and I guess the legal people _can_ respond.
   
   The ASF specific template looks like:
   
   ```
   Licensed to the Apache Software Foundation (ASF) under one
   or more contributor license agreements.  See the NOTICE file
   distributed with this work for additional information
   regarding copyright ownership.  The ASF licenses this file
   to you under the Apache License, Version 2.0 (the
   "License"); you may not use this file except in compliance
   with the License.  You may obtain a copy of the License at
   
     http://www.apache.org/licenses/LICENSE-2.0
   
   Unless required by applicable law or agreed to in writing,
   software distributed under the License is distributed on an
   "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
   KIND, either express or implied.  See the License for the
   specific language governing permissions and limitations
   under the License.
   ```


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [skywalking] tisonkun commented on issue #10223: [Bug] skyWalking-eyes checks header should not require to match this year

Posted by GitBox <gi...@apache.org>.
tisonkun commented on issue #10223:
URL: https://github.com/apache/skywalking/issues/10223#issuecomment-1368367227

   @wu-sheng I don't have a clear solution yet. It can have multiple solutions.
   
   The issue is whether it's by design that users should update "year" in the license header every year. If not, it's a bug.
   
   According to the solution part, the first thing to decide is whether we analyze the license header in file, or we keep the way to generate content and do a string match. `license-maven-plugin-git` follows the latter one, which provides some variables to represent a year range or per-file creation year.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [skywalking] fuyufjh commented on issue #10223: [Bug] skyWalking-eyes checks header should not require to match this year

Posted by GitBox <gi...@apache.org>.
fuyufjh commented on issue #10223:
URL: https://github.com/apache/skywalking/issues/10223#issuecomment-1369391179

   > I personally think the users should update the year in license every year, checking the year according to something like git modification time doesn't make much sense to me.
   > 
   > But if for any reason the license is not applicable to the work since a year, say 2020, I agree we can have a configuration similar to `copyright-owner`, let's call it `copyright-years` for now and users should set `copyright-years` to the fixed year(range).
   > 
   > In short, my thought is: if the license is still applicable to the work, the year should be updated annually
   
   I did some googling and it turns out the year in the license header should be the year of publication, legally.
   
   See
   
   - https://softwareengineering.stackexchange.com/a/130479
   - https://web.archive.org/web/20111127204440/http://www.contentious.com/2007/01/07/copyright-notice-is-the-year-really-necessary/


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [skywalking] fuyufjh commented on issue #10223: [Bug] skyWalking-eyes checks header should not require to match this year

Posted by GitBox <gi...@apache.org>.
fuyufjh commented on issue #10223:
URL: https://github.com/apache/skywalking/issues/10223#issuecomment-1369391744

   Additionally, from an engineer's perspective, I don't want to update the licenses of **all** files once a year. It's tedious and stupid as well. 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [skywalking] wu-sheng commented on issue #10223: [Bug] skyWalking-eyes checks header should not require to match this year

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on issue #10223:
URL: https://github.com/apache/skywalking/issues/10223#issuecomment-1369398601

   > > Additionally, from an engineer's perspective, I don't want to update the licenses of **all** files once a year. It's tedious and stupid as well.
   > 
   > 
   > 
   > Agree. Maybe you can file an issue on https://issues.apache.org/jira/projects/LEGAL. Although software under the ASF uses a different header that doesn't have a copyright line, it's still an issue with Apache License 2.0 and I guess the legal people _can_ respond.
   > 
   > 
   > 
   > The ASF specific template looks like:
   > 
   > 
   > 
   > ```
   > 
   > Licensed to the Apache Software Foundation (ASF) under one
   > 
   > or more contributor license agreements.  See the NOTICE file
   > 
   > distributed with this work for additional information
   > 
   > regarding copyright ownership.  The ASF licenses this file
   > 
   > to you under the Apache License, Version 2.0 (the
   > 
   > "License"); you may not use this file except in compliance
   > 
   > with the License.  You may obtain a copy of the License at
   > 
   > 
   > 
   >   http://www.apache.org/licenses/LICENSE-2.0
   > 
   > 
   > 
   > Unless required by applicable law or agreed to in writing,
   > 
   > software distributed under the License is distributed on an
   > 
   > "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
   > 
   > KIND, either express or implied.  See the License for the
   > 
   > specific language governing permissions and limitations
   > 
   > under the License.
   > 
   > ```
   
   According to ASF, the year should be in notice, and it should be updated year by year for sure.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [skywalking] wu-sheng commented on issue #10223: [Bug] skyWalking-eyes checks header should not require to match this year

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on issue #10223:
URL: https://github.com/apache/skywalking/issues/10223#issuecomment-1369436133

   > Additionally, from an engineer's perspective, I don't want to update the licenses of **all** files once a year. It's tedious and stupid as well.
   
   I am afraid this should focus on the LEGAL thing.  @tisonkun 's question on the foundation matters first.
   
   > ... and I submitted it https://issues.apache.org/jira/browse/LEGAL-629.
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [skywalking] tisonkun closed issue #10223: [Bug] skyWalking-eyes checks header should not require to match this year

Posted by GitBox <gi...@apache.org>.
tisonkun closed issue #10223: [Bug] skyWalking-eyes checks header should not require to match this year
URL: https://github.com/apache/skywalking/issues/10223


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [skywalking] GuangmingLuo commented on issue #10223: [Bug] skyWalking-eyes checks header should not require to match this year

Posted by "GuangmingLuo (via GitHub)" <gi...@apache.org>.
GuangmingLuo commented on issue #10223:
URL: https://github.com/apache/skywalking/issues/10223#issuecomment-1407315983

   It seems that there are two solutions. One is to follow the release date such as 2021 and specify it in the configuration file. The other is to update to the latest date such as 2023 on January 1 every year. The latter is really unfriendly to project maintainers and will cause meaningless code contribution.
   
   I will take the first solution as @kezhenxu94 has supported recently in skywalking-eyes.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [skywalking] wu-sheng commented on issue #10223: [Bug] skyWalking-eyes checks header should not require to match this year

Posted by GitBox <gi...@apache.org>.
wu-sheng commented on issue #10223:
URL: https://github.com/apache/skywalking/issues/10223#issuecomment-1369343887

   > While in another aspect that `header fix` will add a brand new header instead of modifying in place, which make the "update annually" quick complex to do. But it should be another issue.
   
   This seems like a new command parameter, like `mvn setversion`.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [skywalking] tisonkun commented on issue #10223: [Bug] skyWalking-eyes checks header should not require to match this year

Posted by GitBox <gi...@apache.org>.
tisonkun commented on issue #10223:
URL: https://github.com/apache/skywalking/issues/10223#issuecomment-1369342992

   While in another aspect that `header fix` will add a brand new header instead of modifying in place, which make the "update annually" quick complex to do. But it should be another issue.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [skywalking] tisonkun commented on issue #10223: [Bug] skyWalking-eyes checks header should not require to match this year

Posted by GitBox <gi...@apache.org>.
tisonkun commented on issue #10223:
URL: https://github.com/apache/skywalking/issues/10223#issuecomment-1369342670

   > In short, my thought is: if the license is still applicable to the work, the year should be updated annually
   
   OK. Then we can close this issue as won't fix (by design).


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [skywalking] tisonkun commented on issue #10223: [Bug] skyWalking-eyes checks header should not require to match this year

Posted by GitBox <gi...@apache.org>.
tisonkun commented on issue #10223:
URL: https://github.com/apache/skywalking/issues/10223#issuecomment-1369394492

   ... and I submitted it https://issues.apache.org/jira/browse/LEGAL-629.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@skywalking.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org