Skip to content

feat: copyright header for proprietary code#255

Merged
kevgo merged 16 commits intomasterfrom
kg-header-proprietary
Nov 5, 2022
Merged

feat: copyright header for proprietary code#255
kevgo merged 16 commits intomasterfrom
kg-header-proprietary

Conversation

@kevgo
Copy link
Copy Markdown
Contributor

@kevgo kevgo commented Nov 3, 2022

Allow adding copyright headers for proprietary code.

Related Issue or Design Document

https://github.com/ory-corp/cloud/issues/3706

Checklist

  • I have read the contributing guidelines
    and signed the CLA.
  • I have referenced an issue containing the design document if my change
    introduces a new feature.
  • I have read the security policy.
  • I confirm that this pull request does not address a security
    vulnerability. If this pull request addresses a security vulnerability, I
    confirm that I got approval (please contact
    security@ory.sh) from the maintainers to push
    the changes.
  • I have added tests that prove my fix is effective or that my feature
    works.
  • I have added the necessary documentation within the code base (if
    appropriate).

@kevgo kevgo requested review from alnr and jonas-jonas November 3, 2022 21:33
kevgo added 6 commits November 3, 2022 16:51
# Conflicts:
#	cmd/dev/headers/license.go
#	cmd/dev/headers/license_test.go
# Conflicts:
#	cmd/dev/headers/copyright.go
Copy link
Copy Markdown
Member

@jonas-jonas jonas-jonas left a comment

Choose a reason for hiding this comment

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

Two minor things.

Comment thread cmd/dev/headers/copyright_test.go Outdated
dir.CreateFile("yaml.yml", "one: two\nalpha: beta")
dir.CreateFile("yaml.yaml", "one: two\nalpha: beta")
err := AddHeaders(dir.Path, 2022, []string{})
err := AddHeaders(dir.Path, 2022, HEADER_TEMPLATE_OPEN_SOURCE, []string{})
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Should we have a test for the proprietary license as well? In case someone changes that text by accident.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Ideally we would have real end-to-end tests for this feature, written in https://github.com/cucumber/godog. The infrastructure for that is missing and it doesn't make sense to add it just for these internal features.

Following your suggestion, I have added unit tests that at least demo how the file contents would look like for the different template types.

Comment thread cmd/dev/headers/copyright.go Outdated
// contains the folders to exclude
var exclude []string

// indicates whether to create a headerType header (
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
// indicates whether to create a headerType header (
// indicates whether to create a headerType header

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good catch, fixed

@kevgo
Copy link
Copy Markdown
Contributor Author

kevgo commented Nov 4, 2022

@jonas-jonas all comments address, PTAL

@kevgo kevgo merged commit c537abc into master Nov 5, 2022
@kevgo kevgo deleted the kg-header-proprietary branch November 5, 2022 01:24
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.

2 participants