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

Add license header file and script #1256

Merged
merged 8 commits into from
Sep 25, 2023

Conversation

michael-valdron
Copy link
Member

@michael-valdron michael-valdron commented Sep 18, 2023

What does this PR do?

Adds the license header file containing the license header which should be included under all source files. In addition, a the add_licenses.sh script is included to automate the process of adding license headers to all Go source files.

Which issue(s) does this PR fix

fixes #1104

PR acceptance criteria

Testing and documentation do not need to be complete in order for this PR to be approved. We just need to ensure tracking issues are opened.

  • Open new test/doc issues under the devfile/api repo
  • Check each criteria if:
  • There is a separate tracking issue. Add the issue link under the criteria
    or
  • test/doc updates are made as part of this PR
  • If unchecked, explain why it's not needed

How to test changes / Special notes to the reviewer

@michael-valdron
Copy link
Member Author

I feel these are N/A to these changes.

@yangcao77
Copy link
Contributor

you may want to add license to existing files as well.

@michael-valdron
Copy link
Member Author

you may want to add license to existing files as well.

fixed in 471ff66

@codecov
Copy link

codecov bot commented Sep 18, 2023

Codecov Report

Patch and project coverage have no change.

Comparison is base (f331a0b) 35.79% compared to head (88feb0f) 35.79%.

Additional details and impacted files
@@           Coverage Diff           @@
##             main    #1256   +/-   ##
=======================================
  Coverage   35.79%   35.79%           
=======================================
  Files          52       52           
  Lines        6679     6679           
=======================================
  Hits         2391     2391           
  Misses       4144     4144           
  Partials      144      144           
Files Changed Coverage Δ
.../apis/workspaces/v1alpha1/attributes_conversion.go 34.61% <ø> (ø)
...kg/apis/workspaces/v1alpha1/commands_conversion.go 74.07% <ø> (ø)
...workspaces/v1alpha1/component_plugin_conversion.go 19.14% <ø> (ø)
.../apis/workspaces/v1alpha1/components_conversion.go 70.21% <ø> (ø)
pkg/apis/workspaces/v1alpha1/conversion.go 74.28% <ø> (ø)
...pis/workspaces/v1alpha1/devworkspace_conversion.go 0.00% <ø> (ø)
pkg/apis/workspaces/v1alpha1/devworkspace_types.go 100.00% <ø> (ø)
...spaces/v1alpha1/devworkspacetemplate_conversion.go 0.00% <ø> (ø)
.../workspaces/v1alpha1/devworkspacetemplate_types.go 100.00% <ø> (ø)
pkg/apis/workspaces/v1alpha1/events_conversion.go 100.00% <ø> (ø)
... and 34 more

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@michael-valdron
Copy link
Member Author

failing validation on generated source fixed in 829a3e8

@michael-valdron
Copy link
Member Author

add_license.sh no longer includes generated source when appending license headers: 6802642

#
#
# Copyright Red Hat
#
Copy link
Member

Choose a reason for hiding this comment

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

I wonder if we need to really add copyright to workflow scripts.. Do folks usually do this?

Copy link
Member Author

Choose a reason for hiding this comment

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

For our repos, this can be a bit hit or miss, for this repo none of them, for registry-support there's https://github.com/devfile/registry-support/blob/a95cc889ecaf131b2ce76535ff9d9179607240be/.github/workflows/ci.yaml.

As for the open source standard for this, I'm not sure. I will investigate what other projects are doing and can revert these if its not something we want to do.

Copy link
Member Author

Choose a reason for hiding this comment

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

These do not have license headers under the workflows:

These do have license headers under the workflows:

Looks like most don't do it, including odo.

Copy link
Member Author

Choose a reason for hiding this comment

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

After reviewing Red Hat legal's recommendation for license header inclusion, I feel we should keep the license headers here.

@@ -0,0 +1,15 @@


Copyright Red Hat
Copy link
Member

Choose a reason for hiding this comment

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

One other small question, I noticed we are removing the years, curious as to why..

Copy link
Member Author

Choose a reason for hiding this comment

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

During devtools week discussions (Sep 11-15) we decided to make this change to follow Red Hat legal's guidelines on copyright labeling under the license headers.

@michael-valdron
Copy link
Member Author

Checked because these passed but there are no changes here that should effect the test cases from passing.

  • Client Impact

Leaving unchecked as there is no client impact from these changes.

@michael-valdron
Copy link
Member Author

michael-valdron commented Sep 21, 2023

Changing the WIP: #1104 (comment)

@michael-valdron michael-valdron changed the title Add license header file and script [WIP]Add license header file and script Sep 21, 2023
@openshift-ci openshift-ci bot removed the lgtm label Sep 21, 2023
@michael-valdron michael-valdron changed the title [WIP]Add license header file and script Add license header file and script Sep 21, 2023
@michael-valdron
Copy link
Member Author

Changing the WIP: #1104 (comment)

Addressed in 8dfc215, 88feb0f

@openshift-ci openshift-ci bot added the lgtm label Sep 22, 2023
@openshift-ci
Copy link

openshift-ci bot commented Sep 22, 2023

[APPROVALNOTIFIER] This PR is NOT APPROVED

This pull-request has been approved by: maysunfaisal, michael-valdron

The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@michael-valdron
Copy link
Member Author

cc: @amisevsk

@michael-valdron
Copy link
Member Author

cc: @amisevsk

Based on the slack thread discussion I feel we can merge this now.

@michael-valdron michael-valdron merged commit e05a235 into devfile:main Sep 25, 2023
6 checks passed
yangcao77 added a commit that referenced this pull request Oct 11, 2023
* 2.2.0 release cut

Signed-off-by: Stephanie <[email protected]>

* enable gosec (#969)

* enable gosec

Signed-off-by: Kim Tsao <[email protected]>

* Fix G601 errors

Signed-off-by: Kim Tsao <[email protected]>

* Fix warnings

Signed-off-by: Kim Tsao <[email protected]>

* Add newline

Signed-off-by: Kim Tsao <[email protected]>

Signed-off-by: Kim Tsao <[email protected]>

* Update the devfile spec to 2.2.1 alpha (#980)

Signed-off-by: Paul Schultz <[email protected]>

* Bump kubernetes-client/gen revision to fix git dubious ownership error (#1045)

* bump kubernetes-client/gen revision to fix git dubious ownership error

Signed-off-by: Michael Valdron <[email protected]>

* whitespace changes.

Signed-off-by: Michael Valdron <[email protected]>

* set openapi generator ref to version which supports typescript generation.

Signed-off-by: Michael Valdron <[email protected]>

---------

Signed-off-by: Michael Valdron <[email protected]>

* Fix Dependabot issues (#1047)

* fix dependabot issues, requires a bump in k8s versions

Signed-off-by: Kim Tsao <[email protected]>

* re-generated devworkspace files

Signed-off-by: Kim Tsao <[email protected]>

* Vendor updates

Signed-off-by: Kim Tsao <[email protected]>

---------

Signed-off-by: Kim Tsao <[email protected]>

* fix gosec v2.14.0 (#1034)

Signed-off-by: Michael Valdron <[email protected]>

* Update python runtime version for `release-typescript-models` job (#1051)

* bump python runtime version for 'release-typescript-models' job.

Signed-off-by: Michael Valdron <[email protected]>

* bump setup-python action to v4 for 'release-typescript-models' job.

Signed-off-by: Michael Valdron <[email protected]>

---------

Signed-off-by: Michael Valdron <[email protected]>

* Add workflow for managing stale issues & PRs (#1055)

Adds a GitHub workflow for managing stale & rotten issues and PRs. 

Issues & PRs are marked stale after 90 days of inactivity. After 60 further days, they are marked as rotten and closed.

* Clarify hotReloadCapable field (#1091)

* Clarify hotReloadCapable field

Signed-off-by: Philippe Martin <[email protected]>

* Auto-generated

Signed-off-by: Philippe Martin <[email protected]>

* Specify isDefault

Signed-off-by: Philippe Martin <[email protected]>

* Clarify description

Signed-off-by: Philippe Martin <[email protected]>

---------

Signed-off-by: Philippe Martin <[email protected]>

* update kubernetes/openshift endpoint validation (#1098)

* update endpoint validation

Signed-off-by: Stephanie <[email protected]>

* update unit test

Signed-off-by: Stephanie <[email protected]>

* update the test error check to be more clear

Signed-off-by: Stephanie <[email protected]>

* add unit test for two kube components

Signed-off-by: Stephanie <[email protected]>

---------

Signed-off-by: Stephanie <[email protected]>

* Update release doc (#1110)

Signed-off-by: Kim Tsao <[email protected]>

* Update directly executed scripts inside workflows (#1107)

* Update directly executed scripts on workflows

Signed-off-by: thepetk <[email protected]>

* Update directly executed scripts on bash scripts

Signed-off-by: thepetk <[email protected]>

---------

Signed-off-by: thepetk <[email protected]>

* Add area alizer label to all issue templates (#1149)

Signed-off-by: thepetk <[email protected]>

* Update deprecated github actions to latest version (#1231)

* Update deprecated github actions

Signed-off-by: thepetk <[email protected]>

* Remove jsonschema dep from validate samples

Signed-off-by: thepetk <[email protected]>

---------

Signed-off-by: thepetk <[email protected]>

* Add license header file and script (#1256)

* add license header file

Signed-off-by: Michael Valdron <[email protected]>

* addlicense script

Signed-off-by: Michael Valdron <[email protected]>

* update README with instructions on adding license headers

Signed-off-by: Michael Valdron <[email protected]>

* update license headers under source files

Signed-off-by: Michael Valdron <[email protected]>

* remove license header from generated source

Signed-off-by: Michael Valdron <[email protected]>

* add_license.sh ignores zz_generated.* source files

Signed-off-by: Michael Valdron <[email protected]>

* check license headers script added

Signed-off-by: Michael Valdron <[email protected]>

* check license headers script added to CI workflow

Signed-off-by: Michael Valdron <[email protected]>

---------

Signed-off-by: Michael Valdron <[email protected]>

* add signoff

Signed-off-by: Stephanie <[email protected]>

---------

Signed-off-by: Stephanie <[email protected]>
Signed-off-by: Kim Tsao <[email protected]>
Signed-off-by: Paul Schultz <[email protected]>
Signed-off-by: Michael Valdron <[email protected]>
Signed-off-by: Philippe Martin <[email protected]>
Signed-off-by: thepetk <[email protected]>
Co-authored-by: Kim Tsao <[email protected]>
Co-authored-by: Paul Schultz <[email protected]>
Co-authored-by: Michael Valdron <[email protected]>
Co-authored-by: Michael Valdron <[email protected]>
Co-authored-by: John Collier <[email protected]>
Co-authored-by: Philippe Martin <[email protected]>
Co-authored-by: Theofanis Petkos <[email protected]>
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.

Devfile API repo missing license header
3 participants