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

feat: check source images built on top of Konflux images #1154

Merged

Conversation

tkdchen
Copy link
Contributor

@tkdchen tkdchen commented May 8, 2024

Description

Update tests for source container build to ensure builds based on Konflux images work well to generate source images.

PR adding a test repository: konflux-ci/build-definitions#1006

Issue ticket number and link

STONEBLD-2256

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Should pass the CI.

Checklist:

  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • [-] I have made corresponding changes to the documentation
  • I have added meaningful description with JIRA/GitHub issue key(if applicable), for example HASSuiteDescribe("STONE-123456789 devfile source")
  • [-] I have updated labels (if needed)

Copy link

openshift-ci bot commented May 8, 2024

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

@tkdchen
Copy link
Contributor Author

tkdchen commented May 8, 2024

/retest

@tkdchen tkdchen force-pushed the STONEBLD-2256-built-based-on-konflux-image branch 4 times, most recently from c34bee9 to 19c60f1 Compare May 9, 2024 04:40
@tkdchen
Copy link
Contributor Author

tkdchen commented May 9, 2024

/retest

1 similar comment
@tkdchen
Copy link
Contributor Author

tkdchen commented May 9, 2024

/retest

@tkdchen tkdchen force-pushed the STONEBLD-2256-built-based-on-konflux-image branch from 19c60f1 to 86d929d Compare May 9, 2024 08:18
@tkdchen tkdchen marked this pull request as ready for review May 9, 2024 08:30
@openshift-ci openshift-ci bot requested review from dheerajodha and rcerven May 9, 2024 08:30
@tkdchen tkdchen requested review from tisutisu, mkosiarc and chmeliik May 9, 2024 08:31
@tkdchen tkdchen force-pushed the STONEBLD-2256-built-based-on-konflux-image branch 4 times, most recently from f35a59a to b528bfd Compare May 10, 2024 05:57
Expect(dockerfileContent).ShouldNot(BeEmpty())

newFrom := fmt.Sprintf("FROM %s", parentImageUrl)
updatedContent := strings.ReplaceAll(dockerfileContent, "FROM scratch", newFrom)
Copy link
Contributor

Choose a reason for hiding this comment

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

What test repo will this be used for? I still don't really understand why we need to replace the FROM dynamically.

Why can't it be FROM <some-image-that-we-build-once-and-never-change>?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The image built from a test repo by a build-definitions CI job is bound to the build-definitions' last commit hash, it can't be pinned. I also would like to set the image built from a test repo under redhat-appstudio-qe rather than others e.g. my personal github org.

But now, I'm considering the way you mentioned either. Asking for help from QE to see which Konflux (prod/staging/qe) I can onboard the test repo to in order to build the image <some-image-that-we-build-once-and-never-change>.

@tkdchen tkdchen force-pushed the STONEBLD-2256-built-based-on-konflux-image branch from b528bfd to bcd637e Compare May 11, 2024 06:26
@tkdchen tkdchen force-pushed the STONEBLD-2256-built-based-on-konflux-image branch from bcd637e to ce146d6 Compare May 13, 2024 03:57
@tkdchen tkdchen marked this pull request as draft May 13, 2024 04:20
@tkdchen tkdchen force-pushed the STONEBLD-2256-built-based-on-konflux-image branch from 7b423b6 to 7804255 Compare May 13, 2024 08:55
@tkdchen tkdchen marked this pull request as ready for review May 13, 2024 09:00
@openshift-ci openshift-ci bot requested review from albarbaro and lcarva May 13, 2024 09:00
@tkdchen tkdchen requested a review from chmeliik May 13, 2024 09:00
STONEBLD-2256

Major changes:

* IsAppSourceFilesExists is updated to check multiple app source
  archives. It is renamed to doAppSourceFilesExist.
* IsPreFetchDependenciesFilesExists checks if prefetched sources are
  included in the source image. For simplicity, it only checks Python
  requirements.
* Refactoring part of the code.

Signed-off-by: Chenxiong Qi <[email protected]>
@tkdchen tkdchen force-pushed the STONEBLD-2256-built-based-on-konflux-image branch from 7804255 to e8cff6f Compare May 13, 2024 09:01
Copy link

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

Copy link
Contributor

@chmeliik chmeliik left a comment

Choose a reason for hiding this comment

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

LGTM 👍

For next time, it would be nice to split the refactoring into a separate commit. Otherwise it can be hard to tell what is just refactoring and what are new changes

@tkdchen
Copy link
Contributor Author

tkdchen commented May 14, 2024

/retest

@tkdchen tkdchen requested a review from tisutisu May 14, 2024 08:39
@tisutisu
Copy link
Contributor

/lgtm
/approve

Copy link

openshift-ci bot commented May 14, 2024

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: chmeliik, tisutisu

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

The pull request process is described 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

@tisutisu tisutisu merged commit f43f140 into konflux-ci:main May 14, 2024
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants