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

Write a script to replace long Apache license headers with a short SPDX reference. #5807

Closed
yurishkuro opened this issue Aug 5, 2024 · 1 comment · Fixed by #5808
Closed
Labels
good first issue Good for beginners help wanted Features that maintainers are willing to accept but do not have cycles to implement

Comments

@yurishkuro
Copy link
Member

Historically we used multi-line Apache v2 header in the files, e.g.

// Licensed under the Apache License, Version 2.0 (the "License");

Recently we started using just an SPDX reference:

// SPDX-License-Identifier: Apache-2.0

  • Write a script to find the files with the long header and replace it with the SPDX line.
  • Store the script under ./scripts/
  • Do NOT include update to the source files in the PR itself, only the script (a maintainer will then run it on the repo).
@yurishkuro yurishkuro added help wanted Features that maintainers are willing to accept but do not have cycles to implement good first issue Good for beginners labels Aug 5, 2024
@thecaffeinedev
Copy link
Contributor

Hi @yurishkuro I have created a PR for this. Could you please check it and let me know?

yurishkuro added a commit that referenced this issue Aug 14, 2024
## Which problem is this PR solving?
- Resolves #5807

## Description of the changes
- Added a new Python script `update_license_headers.py` in the
`./scripts/` directory
- Replaces old Apache headers with SPDX identifiers
- Works on .go files
- No changes to source files are included in this PR.


## How was this change tested?
- I gave it a spin on the `cmd` folder. Seemed to work fine - it found
the right files and swapped out the headers. I checked a few of the
updated files manually to make sure it did what it was supposed to.


## Checklist
- [x] I have read
https://github.com/jaegertracing/jaeger/blob/master/CONTRIBUTING_GUIDELINES.md
- [x] I have signed all commits
- [ ] I have added unit tests for the new functionality
- [x] I have run lint and test steps successfully
  - for `jaeger`: `make lint test`
  - for `jaeger-ui`: `yarn lint` and `yarn test`

---------

Signed-off-by: Prabhat <[email protected]>
Signed-off-by: Prabhat Kumar Sahu <[email protected]>
Signed-off-by: Yuri Shkuro <[email protected]>
Co-authored-by: Yuri Shkuro <[email protected]>
Co-authored-by: Yuri Shkuro <[email protected]>
JaredTan95 pushed a commit to JaredTan95/jaeger that referenced this issue Aug 28, 2024
## Which problem is this PR solving?
- Resolves jaegertracing#5807

## Description of the changes
- Added a new Python script `update_license_headers.py` in the
`./scripts/` directory
- Replaces old Apache headers with SPDX identifiers
- Works on .go files
- No changes to source files are included in this PR.

## How was this change tested?
- I gave it a spin on the `cmd` folder. Seemed to work fine - it found
the right files and swapped out the headers. I checked a few of the
updated files manually to make sure it did what it was supposed to.

## Checklist
- [x] I have read
https://github.com/jaegertracing/jaeger/blob/master/CONTRIBUTING_GUIDELINES.md
- [x] I have signed all commits
- [ ] I have added unit tests for the new functionality
- [x] I have run lint and test steps successfully
  - for `jaeger`: `make lint test`
  - for `jaeger-ui`: `yarn lint` and `yarn test`

---------

Signed-off-by: Prabhat <[email protected]>
Signed-off-by: Prabhat Kumar Sahu <[email protected]>
Signed-off-by: Yuri Shkuro <[email protected]>
Co-authored-by: Yuri Shkuro <[email protected]>
Co-authored-by: Yuri Shkuro <[email protected]>
Signed-off-by: Jared Tan <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for beginners help wanted Features that maintainers are willing to accept but do not have cycles to implement
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants