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

chore(license): update license signature #406

Merged
merged 6 commits into from
Jan 4, 2024
Merged

Conversation

sumire88
Copy link
Contributor

@sumire88 sumire88 commented Jan 3, 2024

Background

Extend license signature period.

Results are generated with the following command:

rg -F 'Copyright (c) 2022-2023' --files-with-matches . | xargs sed -i 's/Copyright (c) 2022-2023/Copyright (c) 2022-2024'/g

rg -F 'Copyright (c) 2023' --files-with-matches . | xargs sed -i 's/Copyright (c) 2022-2023/Copyright (c) 2022-2024'/g

Also, added a dedicated script to add license info/signature to qualified *.go files.

◆ dae ❯❯❯ ./hack/maintenance/append_license_signature.sh
Lines inserted into ./pkg/trie/trie.go
Lines inserted into ./component/sniffing/quic_test.go
Lines inserted into ./cmd/run.go
Lines inserted into ./cmd/cmd.go
Lines inserted into ./component/sniffing/internal/quicutils/hkdf.go
Lines inserted into ./cmd/internal/su.go
Lines inserted into ./component/outbound/dialer/utils.go
Lines inserted into ./common/netutils/ip46_test.go
Lines inserted into ./component/outbound/dialer/direct.go
Lines inserted into ./common/netutils/dnsconfig_unix.go
Lines inserted into ./component/outbound/dialer/dialer.go
Lines inserted into ./component/outbound/dialer/annotation.go
Lines inserted into ./common/consts/net.go
Lines inserted into ./common/consts/app.go
Lines inserted into ./control/packet_sniffer_pool_test.go
Lines inserted into ./control/anyfrom_pool.go

Automation/Trigger

Note

I've also added a custom pre-commit-hook to automatically inspect and add license-signature-info for target *.go files.

# .pre-commit-config.yaml
repos:
  - repo: local
    hooks:
      - id: check-license-signature
        name: license-signature-automation
        entry: ./hack/maintenance/append_license_signature.sh
        language: script
        files: \.go$

To activate this hook, run the following:

# arch
sudo pacman -S pre-commit
# homebrew
brew install pre-commit

# install pre-commit-hooks
pre-commit install

Afterwards, every time after you run git commit command, the hooks will kick off and run automation accordingly.

PoC:

image

image

Checklist

Full Changelogs

  • chore(license): extend license valid period

Issue Reference

NA

@sumire88 sumire88 requested a review from a team as a code owner January 3, 2024 12:37
@dae-prow dae-prow bot added the chore label Jan 3, 2024
@sumire88
Copy link
Contributor Author

sumire88 commented Jan 3, 2024

Ready for review.

@sumire88 sumire88 changed the title chore(license): extend license valid period chore(license): update license signature Jan 3, 2024
Copy link
Contributor

@mzz2017 mzz2017 left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks for your passion.

@sumire88 sumire88 merged commit 3184aa5 into main Jan 4, 2024
27 checks passed
@sumire88 sumire88 deleted the license-timestamp-upgrade branch January 4, 2024 09:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants