Skip to content

Move products to a dedicated folder #7018

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

Closed
wants to merge 0 commits into from

Conversation

matejak
Copy link
Member

@matejak matejak commented May 19, 2021

This PR aims to make the project directory tree more structured.
As it just moves directories, the backward compatibility of patches can be achieved by creating symlinks from the root directory:

for prod in products/*; do ln -s "$prod" $(basename "$prod"); done

@matejak matejak added this to the 0.1.57 milestone May 19, 2021
@openscap-ci
Copy link
Collaborator

openscap-ci commented May 19, 2021

Changes identified:
Others:
 Changes in Python files.

Show details

Others:
 Python abstract syntax tree change found in build-scripts/build_rule_playbooks.py.
 Python abstract syntax tree change found in ssg/products.py.
 Python abstract syntax tree change found in tests/ssg_test_suite/common.py.
 Python abstract syntax tree change found in tests/test_machine_only_rules.py.
 Python abstract syntax tree change found in tests/test_parse_affected.py.
 Python abstract syntax tree change found in tests/test_parse_platform.py.
 Python abstract syntax tree change found in tests/unit/ssg-module/test_controls.py.
 Python abstract syntax tree change found in utils/rule_dir_json.py.

Recommended tests to execute:
 (cd build && cmake ../ && ctest -j4)

@JAORMX
Copy link
Contributor

JAORMX commented May 19, 2021

This change makes sense to me and it does make it easier to view the relevant covered products. Let's wait for more folks from the community to give feedback on this. I'd also like to get some time to change the OCP4 CI tests to reflect this new structure before merging this, so we don't have a long breakage.

@carlosmmatos
Copy link
Contributor

@matejak thanks for the PR, I've been advocating for a change like this to clean up the structure of the project. I think this will make things easier to digest at first glance, and hopefully easier to follow for new contributors.

I also agree with @JAORMX that we should get more feedback from the community members to see if this is the appropriate way to clean up the structure, or perhaps there are other ideas.

@openshift-ci openshift-ci bot added the needs-rebase Used by openshift-ci bot. label May 20, 2021
@matejak
Copy link
Member Author

matejak commented May 21, 2021

I completely agree to take this one slow. I think that we can leave it open at least until the end of May to accumulate feedback, and if the proposal is still alive, then I will resolve confilcts and we can then consider merging this.

@carlosmmatos
Copy link
Contributor

I completely agree to take this one slow. I think that we can leave it open at least until the end of May to accumulate feedback, and if the proposal is still alive, then I will resolve confilcts and we can then consider merging this.

Do you want to add this to the discussions?

@matejak
Copy link
Member Author

matejak commented May 21, 2021

Do you want to add this to the discussions?

I don't know, and I am leaning towards that it isn't needed - the discussion itself can take place here, and I have announced the intention on the mailing list, which is a traditional communication channel. However, if there is no feedback next week, I think that we can announce in the GH discussion.

JAORMX added a commit to JAORMX/ocp4e2e that referenced this pull request May 27, 2021
This automatically clones the content repo, from which we get the test
info. This is done by detecting if the ROOT_DIR env variable is empty:
if it's empty, we clone it and set the env variable appropriately.

This also takes into account the `products` dir that's being proposed
[1], so the OCP4 e2e tests will not be affected by this change.

[1] ComplianceAsCode/content#7018

Signed-off-by: Juan Antonio Osorio Robles <jaosorior@redhat.com>
@matejak matejak force-pushed the separate_products branch from a8e30e0 to cc5a0cc Compare June 2, 2021 10:14
@openshift-ci openshift-ci bot removed the needs-rebase Used by openshift-ci bot. label Jun 2, 2021
@JAORMX
Copy link
Contributor

JAORMX commented Jun 2, 2021

/retest

3 similar comments
@JAORMX
Copy link
Contributor

JAORMX commented Jun 2, 2021

/retest

@JAORMX
Copy link
Contributor

JAORMX commented Jun 3, 2021

/retest

@matejak
Copy link
Member Author

matejak commented Jun 4, 2021

/retest

@matejak matejak force-pushed the separate_products branch from cc5a0cc to 6f3b163 Compare June 4, 2021 07:43
@openshift-ci openshift-ci bot added the needs-rebase Used by openshift-ci bot. label Jun 5, 2021
@matejak
Copy link
Member Author

matejak commented Jun 7, 2021

I think that as no objections came, it is time to prepare for start seriously considering merging this PR.

@matejak matejak force-pushed the separate_products branch from 6f3b163 to 690ec52 Compare June 7, 2021 15:04
@openshift-ci openshift-ci bot removed the needs-rebase Used by openshift-ci bot. label Jun 7, 2021
@matejak
Copy link
Member Author

matejak commented Jun 8, 2021

/retest

1 similar comment
@matejak
Copy link
Member Author

matejak commented Jun 8, 2021

/retest

@matejak matejak force-pushed the separate_products branch from 690ec52 to 35f7c6f Compare June 8, 2021 12:27
@cipherboy
Copy link
Contributor

@matejak: One suggestion by @richardmaciel-canonical was that if you used git mv you'd get a cleaner diff and patches would apply cleanly. Just a suggestion, since I noticed there are conflicts.

@matejak
Copy link
Member Author

matejak commented Jun 8, 2021

@matejak: One suggestion by @richardmaciel-canonical was that if you used git mv you'd get a cleaner diff and patches would apply cleanly. Just a suggestion, since I noticed there are conflicts.

I think that I have used git mv, and rebasing to solve conflicts is trivial - I never had to edit anything. So I suspect that git is not confused by the move, but Github is.

@matejak matejak force-pushed the separate_products branch from 35f7c6f to 00779d9 Compare June 8, 2021 15:14
@JAORMX
Copy link
Contributor

JAORMX commented Jun 8, 2021

/retest

@JAORMX
Copy link
Contributor

JAORMX commented Jun 9, 2021

/test e2e-aws-ocp4-e8

@matejak
Copy link
Member Author

matejak commented Jun 9, 2021

Note for reviewers - the git diff (not Github diff) is very clean except files that had to be modified because they contained relative paths (s.a. XSLT transforms).

@matejak matejak force-pushed the separate_products branch from 00779d9 to 271161e Compare June 10, 2021 11:25
@ggbecker ggbecker self-assigned this Jun 10, 2021
@ggbecker
Copy link
Member

ggbecker commented Jun 10, 2021

I'm getting this warning when running ./build_product rhel8 and there are no symlinks to products folder in the root directory:

CMake Warning (dev):
  Policy CMP0058 is not set: Ninja requires custom command byproducts to be
  explicit.  Run "cmake --help-policy CMP0058" for policy details.  Use the
  cmake_policy command to set the policy and suppress this warning.

  This project specifies custom command DEPENDS on files in the build tree
  that are not specified as the OUTPUT or BYPRODUCTS of any
  add_custom_command or add_custom_target:

   rhosp13
   rhv4

  For compatibility with versions of CMake that did not have the BYPRODUCTS
  option, CMake is generating phony rules for such files to convince 'ninja'
  to build.

  Project authors should add the missing BYPRODUCTS or OUTPUT options to the
  custom commands that produce these files.
This warning is for project developers.  Use -Wno-dev to suppress it.

If I create the symlinks for these two folder in the root directory then the warning disappears. Do you know what could that be? Do you see the same on your side?

It looks like it's a valid issue: https://github.com/ComplianceAsCode/content/runs/2792925585?check_suite_focus=true#step:4:110

Update1: I'm suspecting that has something to do with these lines: https://github.com/ComplianceAsCode/content/blob/master/cmake/SSGCommon.cmake#L1405-L1408

Update2: Prepending products/ to those products seems to fix the issues, but I'm not 100% sure if that's the correct fix.

@matejak matejak force-pushed the separate_products branch from 271161e to b013182 Compare June 10, 2021 18:01
@JAORMX
Copy link
Contributor

JAORMX commented Jun 11, 2021

/retest

@matejak matejak closed this Jun 11, 2021
@matejak matejak force-pushed the separate_products branch from b013182 to 822cced Compare June 11, 2021 09:09
@ggbecker
Copy link
Member

LGTM. The commits were accidentally pushed directly to master. No need to reopen nor revert. The changes in master look fine. So no need to take any extra action.

@openshift-ci
Copy link

openshift-ci bot commented Jun 11, 2021

@matejak: The following tests failed, say /retest to rerun all failed tests:

Test name Commit Details Rerun command
ci/prow/e2e-aws-ocp4-moderate 822cced link /test e2e-aws-ocp4-moderate
ci/prow/e2e-aws-rhcos4-moderate 822cced link /test e2e-aws-rhcos4-moderate

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.

JAORMX added a commit to JAORMX/ocp4e2e that referenced this pull request Jun 15, 2021
This automatically clones the content repo, from which we get the test
info. This is done by detecting if the ROOT_DIR env variable is empty:
if it's empty, we clone it and set the env variable appropriately.

This also takes into account the `products` dir that's being proposed
[1], so the OCP4 e2e tests will not be affected by this change.

[1] ComplianceAsCode/content#7018

Signed-off-by: Juan Antonio Osorio Robles <jaosorior@redhat.com>
@vojtapolasek vojtapolasek mentioned this pull request Jun 16, 2021
@marcusburghardt marcusburghardt added the enhancement General enhancements to the project. label Jun 28, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement General enhancements to the project.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants