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 header workflow integration 2 #5109

Merged
merged 2 commits into from Jan 20, 2022

Conversation

joeldierkes
Copy link
Contributor

@joeldierkes joeldierkes commented Dec 13, 2021

This commit adds a header check to the github actions.

As of right now, the headers get checked on every push. We could change that to every pull-request if required.

See individual commits for more information.

@joeldierkes joeldierkes changed the title Add header workflow integration Add header workflow integration 2 Dec 13, 2021
@joeldierkes joeldierkes force-pushed the add_header_workflow_integration branch from eb7d6e2 to 122cef8 Compare December 13, 2021 14:27
Copy link
Member

@maany maany left a comment

Choose a reason for hiding this comment

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

Besides the comments I have already left, I noticed that some of the emails in the add-header.py:

("Alessandro Di Girolamo", "<digirola@lxplus030.cern.ch>"): ("Ale Di Girolamo", "<alessandro.di.girolamo@cern.ch>"),

("rcarpa", "<2905943+rcarpa@users.noreply.github.com>"): ("Radu Carpa", "<radu.carpa@cern.ch>"),

look weird/temporary. I guess not all commits by these authors come from the same email address. Are we sure that we should be using these email addresses? WDYT @rcarpa @bari12

bin/rucio-hermes Outdated Show resolved Hide resolved
bin/rucio-necromancer Outdated Show resolved Hide resolved
@joeldierkes joeldierkes force-pushed the add_header_workflow_integration branch 4 times, most recently from 9e048ba to c4b995c Compare December 16, 2021 12:00
@bari12
Copy link
Member

bari12 commented Jan 10, 2022

Is it strictly needed to re-touch every file (422 changes) or can't we just get this up to date over time?

@joeldierkes joeldierkes marked this pull request as draft January 10, 2022 10:11
@joeldierkes
Copy link
Contributor Author

@maany and I discussed that, and the problem is that you have to get the diff between the PR and the master branch. I tried that first, but the commit SHA provided by GitHub Actions is not working properly when a commit is overwritten via a push --force. I also could not find a plugin suitable for that case.

I also don't know anyone who has experience with that particular issue...

@joeldierkes joeldierkes force-pushed the add_header_workflow_integration branch 5 times, most recently from 8e106ef to 5ae6a50 Compare January 12, 2022 10:14
@joeldierkes joeldierkes force-pushed the add_header_workflow_integration branch 5 times, most recently from f490888 to dde77e1 Compare January 12, 2022 14:03
@joeldierkes
Copy link
Contributor Author

Okay, after @bari12 gave some hints on how to get the changed files in GItHub Actions the implementation now only checks the headers of the changed python files.

@joeldierkes joeldierkes marked this pull request as ready for review January 12, 2022 14:05
@joeldierkes joeldierkes linked an issue Jan 14, 2022 that may be closed by this pull request
Copy link
Member

@maany maany left a comment

Choose a reason for hiding this comment

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

Nice work @joeldierkes ! Awesome to see we don't need to parse all the files on every pull request. I've left some minor comments. ;)

.github/workflows/autotest.yml Outdated Show resolved Hide resolved
.github/workflows/autotest.yml Show resolved Hide resolved
.github/workflows/autotest.yml Outdated Show resolved Hide resolved
@rcarpa
Copy link
Contributor

rcarpa commented Jan 17, 2022

I really like the new version. Nice job!

@bari12 bari12 requested review from maany and removed request for bari12 and mlassnig January 17, 2022 08:46
@joeldierkes joeldierkes force-pushed the add_header_workflow_integration branch 7 times, most recently from 8d3e6a0 to 9c163a2 Compare January 17, 2022 17:54
Joel Dierkes added 2 commits January 17, 2022 18:59
The `add_header` script needs to be run after an edit to determine the status of
the header and, if necessary, change the header.

This commit adds the check for the header to the CI/CD. This enforces the usage
of the `add_header` script and ensures a healthy code base.
The `add_header` sript prints the correct header for a file if the `--in-place`
argument is not provided. This is a good way to see changes, however due to this
the output of the CI/CD is too verbose.

This commit disables the output of the output of the correct header, if the
`--check` option is provided. It also displays the number of files checked.
@joeldierkes joeldierkes force-pushed the add_header_workflow_integration branch from 9c163a2 to c305e83 Compare January 17, 2022 17:59
Copy link
Member

@maany maany left a comment

Choose a reason for hiding this comment

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

LGTM

@bari12 bari12 merged commit eba868e into rucio:master Jan 20, 2022
bari12 pushed a commit that referenced this pull request Jan 20, 2022
* Add a header check to the CI Fix #4980

The `add_header` script needs to be run after an edit to determine the status of
the header and, if necessary, change the header.

This commit adds the check for the header to the CI/CD. This enforces the usage
of the `add_header` script and ensures a healthy code base.

* Change the output of the `add_header` script Fix #4980

The `add_header` sript prints the correct header for a file if the `--in-place`
argument is not provided. This is a good way to see changes, however due to this
the output of the CI/CD is too verbose.

This commit disables the output of the output of the correct header, if the
`--check` option is provided. It also displays the number of files checked.
piperov pushed a commit to piperov/rucio that referenced this pull request Feb 25, 2022
* Add a header check to the CI Fix rucio#4980

The `add_header` script needs to be run after an edit to determine the status of
the header and, if necessary, change the header.

This commit adds the check for the header to the CI/CD. This enforces the usage
of the `add_header` script and ensures a healthy code base.

* Change the output of the `add_header` script Fix rucio#4980

The `add_header` sript prints the correct header for a file if the `--in-place`
argument is not provided. This is a good way to see changes, however due to this
the output of the CI/CD is too verbose.

This commit disables the output of the output of the correct header, if the
`--check` option is provided. It also displays the number of files checked.
@joeldierkes joeldierkes deleted the add_header_workflow_integration branch April 5, 2022 08: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.

Integrate the add_header script in the CI/CD
4 participants