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

Expand project guidelines #8314

Merged
merged 5 commits into from May 18, 2022
Merged

Conversation

matejak
Copy link
Member

@matejak matejak commented Mar 8, 2022

Add measures that will help to keep the code maintenance costs under control and that will make code reviews a smoother experience.

@matejak matejak added this to the 0.1.61 milestone Mar 8, 2022
@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Used by openshift-ci bot. label Mar 8, 2022
@openshift-ci
Copy link

openshift-ci bot commented Mar 8, 2022

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@github-actions
Copy link

github-actions bot commented Mar 8, 2022

Start a new ephemeral environment with changes proposed in this pull request:

Open in Gitpod

CONTRIBUTING.md Outdated
* ... passes PR gating tests, or failing tests are waived by means of explaining the reason.
* ... adheres to the [coding style](docs/manual/developer/04_style_guide.md#complianceascode-style-guide).
* ... has been tested. There are following options that allow for testing various aspects of the project:
* [SSG Test Suite](tests/README.md) for rule tests that ensures that test OVAL checks and that test the ability of remediations to satisfty those checks.
Copy link
Collaborator

Choose a reason for hiding this comment

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

Suggested change
* [SSG Test Suite](tests/README.md) for rule tests that ensures that test OVAL checks and that test the ability of remediations to satisfty those checks.
* [SSG Test Suite](tests/README.md) for rule tests that ensures that test OVAL checks and that test the ability of remediations to satisfy those checks.

Add measures that will help to keep the code maintenance costs under control
and that will make code reviews a smoother experience.
Copy link
Member

@Mab879 Mab879 left a comment

Choose a reason for hiding this comment

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

Overall, I really like this. I have few suggestions for improving some wording.

CONTRIBUTING.md Outdated Show resolved Hide resolved
CONTRIBUTING.md Outdated Show resolved Hide resolved
docs/manual/developer/04_style_guide.md Outdated Show resolved Hide resolved
docs/manual/developer/04_style_guide.md Outdated Show resolved Hide resolved
docs/manual/developer/04_style_guide.md Outdated Show resolved Hide resolved
CONTRIBUTING.md Outdated Show resolved Hide resolved
docs/manual/developer/04_style_guide.md Outdated Show resolved Hide resolved
CONTRIBUTING.md Outdated Show resolved Hide resolved
CONTRIBUTING.md Outdated Show resolved Hide resolved
CONTRIBUTING.md Outdated Show resolved Hide resolved
Co-authored-by: Matthew Burket <m@tthewburket.com>
@openshift-ci
Copy link

openshift-ci bot commented Mar 21, 2022

@matejak: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/e2e-aws-ocp4-high 9909af4 link true /test e2e-aws-ocp4-high

Full PR test history. Your PR dashboard.

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

Copy link
Contributor

@cipherboy cipherboy left a comment

Choose a reason for hiding this comment

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

My 2c but I think it looks fairly good and makes sense.

CONTRIBUTING.md Outdated
* ... has been approved by an SME of the area that the PR addresses, which indicates that it is generally a step in a right direction.
* ... passes PR gating tests, or failing tests are waived in a comment by the reviewer explaining the reasoning.
* ... adheres to the [coding style](docs/manual/developer/04_style_guide.md#complianceascode-style-guide).
* ... has been tested. The following options that allow for testing various aspects of the project:
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: remove that

* [Unit tests](tests/unit) that test components of the build system as well as components of the SSG Test Suite.
* Ad-hoc tests that are integrated into the `ctest` chain directly, i.e. the shellcheck test.
* ... updates READMEs, man pages or other documentation when changes of described behavior are introduced.
* ... doesn't contain merge commits - those can be removed by rebasing.
Copy link
Contributor

Choose a reason for hiding this comment

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

Might be helpful to link to a rebasing/git guide if we have one.

Copy link
Member Author

Choose a reason for hiding this comment

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

We don't, please somebody suggest something that is both to the point and isn't located on some obscure blog that may go offline in a couple of years.

Copy link
Member

Choose a reason for hiding this comment

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

Copy link
Member Author

Choose a reason for hiding this comment

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

So for the time being, I would proceed with merging this PR as it is, because your guide doesn't contain all the info that one could be after, and supplying that would take some time. I see no issue with referencing it, or even with putting it here and referencing it from the roles project.

I think that following issues should be covered there:

  • merge commits, how to recognize them
  • what rebase does, and what can be accomplished by interactive rebase (reordering, merge of commits)
  • a few words about conflict resolution - when to expect them and generally how to handle them

Copy link
Member

Choose a reason for hiding this comment

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

We can also turn on a setting in the project that forbids merge commits to help automate this requirement.

CONTRIBUTING.md Outdated
* Ad-hoc tests that are integrated into the `ctest` chain directly, i.e. the shellcheck test.
* ... updates READMEs, man pages or other documentation when changes of described behavior are introduced.
* ... doesn't contain merge commits - those can be removed by rebasing.
* ... is rebased against recent-enough branch that executes the whole range of expected integrated gating tests.
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: Maybe relevant versus expected? The expected behavior, IMO, would be for GitHub to auto-rebase the present target branch state and the proposed PR changes and then run CI on top of that, but sadly it doesn't and instead takes the base branch as-is. :-) Saying relevant would allow for some variation in main branch, but suggest that any tests which impact the proposed changes should be pulled in first. Thoughts?

Copy link
Member Author

Choose a reason for hiding this comment

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

fair enough :-)

CONTRIBUTING.md Outdated
* ... doesn't contain merge commits - those can be removed by rebasing.
* ... is rebased against recent-enough branch that executes the whole range of expected integrated gating tests.
* ... doesn't increase maintenance costs, and if it does, there is a substantial counterbalance.
* ... doesn't impact the build time in a significant way.
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe negatively impact? :-) If we improve the build time significantly, that might be good to merge :D

* Include tests for your contribution.
* Write comments if and only if there is no chance for the code to explain itself.
* Don't put authorship information into the code, Git tracks authorship for you.
Use [SPDX IDs](https://spdx.dev/ids/) for license-related boilerplate in newly written code.
Copy link
Contributor

Choose a reason for hiding this comment

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

Are we suggesting SPDX IDs for all new (code) files or are we saying if a file needs it, we should add it? If the former, should we go back and apply it retroactively? A quick scan of some files in ssg and build-scripts says they're presently lacking, and IMO, I think the LICENSE in the root of the project applies fine enough to avoid SPDX-ing the project.

Copy link
Member Author

Choose a reason for hiding this comment

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

Good point, the suggestion's intention was towards "don't copy-paste the whole license".

@vojtapolasek
Copy link
Collaborator

@Xeicker @dodys @anivan-suse any input on this? I tagged you because you did latest contributions for different products.

Copy link
Contributor

@dodys dodys left a comment

Choose a reason for hiding this comment

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

lgtm, just curious on the SPDX question from Alex

@matejak matejak marked this pull request as ready for review April 26, 2022 15:25
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Used by openshift-ci bot. label Apr 26, 2022
Copy link
Member

@Mab879 Mab879 left a comment

Choose a reason for hiding this comment

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

Just my idea to help clean up the testing requirements.

CONTRIBUTING.md Outdated Show resolved Hide resolved
* Write comments if and only if there is no chance for the code to explain itself.
* Don't put authorship information into the code, Git tracks authorship for you.
Don't copy-paste license text into source files -- use [SPDX IDs](https://spdx.dev/ids/) for that purpose.
* Don't take part in making files longer - files longer than 400 lines should be an exception.
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
* Don't take part in making files longer - files longer than 400 lines should be an exception.
* Don't take part in making files longer - files longer than 250 lines should be an exception.

Currently, Code Climate is set to a 250 LOC limit, we can change that to 400 if you think that is a better limit.

Copy link
Member Author

Choose a reason for hiding this comment

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

So I would converge gradually, so let's set the limit to 400, and then restrict it further when there is a lower amount of findings.

Copy link
Member

Choose a reason for hiding this comment

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

Sounds good; I will get a PR up with the code climate config.

Copy link
Member

Choose a reason for hiding this comment

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

See #8785

@vojtapolasek vojtapolasek modified the milestones: 0.1.62, 0.1.63 May 16, 2022
Co-authored-by: Matthew Burket <m@tthewburket.com>
Copy link
Member

@marcusburghardt marcusburghardt left a comment

Choose a reason for hiding this comment

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

Thank you to everyone who participated in this PR. Comments have been processed and these updates are in good shape. Improvements are always welcome through other PRs.

@marcusburghardt marcusburghardt merged commit ac402a3 into ComplianceAsCode:master May 18, 2022
18 of 19 checks passed
@marcusburghardt marcusburghardt self-assigned this May 18, 2022
@yuumasato yuumasato added the Highlight This PR/Issue should make it to the featured changelog. label Jul 29, 2022
@marcusburghardt marcusburghardt added the governance Issues or pull requests that relate to changes in the projects governance. label May 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
governance Issues or pull requests that relate to changes in the projects governance. Highlight This PR/Issue should make it to the featured changelog.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants