Search before asking
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":
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 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?
Code of Conduct
Search before asking
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
yearplaceholder: https://github.com/korandoru/zeronos/actions/runs/3815180690/jobs/6490013554After running the fix step locally, I notice that it's because the tool require the
yearplaceholder to be resolved as "this year":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
yearplaceholder will report more cases later.Anything else
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 historylicense.git.copyrightYears- the combination ofproject.inceptionYearandlicense.git.copyrightLastYeardelimited by a dash (-), or justproject.inceptionYearifproject.inceptionYearis equal tolicense.git.copyrightLastYearlicense.git.CreationAuthorNameandlicense.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 historylicense.git.copyrightExistenceYears- Similar tolicense.git.copyrightYearsbut usinglicense.git.copyrightCreationYearfor the first yearThis 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?
Code of Conduct