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

Adapt PR and release jobs to enable testing of the Framework repo #170

Merged
merged 13 commits into from
Nov 5, 2024

Conversation

bensze01
Copy link
Contributor

@bensze01 bensze01 commented Jul 3, 2024

This PR enables the testing of the framework repo, by adapting the existing jobs to allow overriding the version of the framework checked out by the CI, as well as enabling the testing of multiple branches of Mbed TLS in a single job.

The framework version is controlled by the newly defined parameters FRAMEWORK_REPO and FRAMEWORK_BRANCH, while MBEDTLS_BRANCH has been extended to allow specifying multiple branches separated by ,.

For automatic PR testing, mbedtls.run_framework_pr_job() is added as an entrypoint, which is called by the Jenkinsfile added by the companion PR Mbed-TLS/mbedtls-framework#33

Tests:

Copy link
Contributor

@minosgalanakis minosgalanakis left a comment

Choose a reason for hiding this comment

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

Looks ok overall, with some minor comments.

To my understanding this change will make the ci do two checkous per branch? One for mbedtls and then the framework indipendantly?

Looking at the combinations of MBEDTLS_BRANCH , FRAMEWORK_BRANCH times the number of branches, that can cause a significant overhead.

Could we download a non shallow copy of MBEDTLS_REPO and share it between jobs, by simply changing the appropriate branch?

vars/environ.groovy Show resolved Hide resolved
vars/analysis.groovy Outdated Show resolved Hide resolved
Pass the branch name along the call chain instead. This is in
preparation for testing multiple branches in the same job.

Signed-off-by: Bence Szépkúti <[email protected]>
Signed-off-by: Bence Szépkúti <[email protected]>
Each branch listed in MBED_TLS_BRANCH (separated by commas) will be
checked out and tested in parallel.

Signed-off-by: Bence Szépkúti <[email protected]>
Signed-off-by: Bence Szépkúti <[email protected]>
IllegalAccessError doesn't match the semantics used here.

Signed-off-by: Bence Szépkúti <[email protected]>
This fixes checkouts for productions jobs that target the framework
repo.

Signed-off-by: Bence Szépkúti <[email protected]>
This commit also refactors failed_builds and outcome_stashes to be
per-branch values by moving them inside BranchInfo.

Signed-off-by: Bence Szépkúti <[email protected]>
minosgalanakis
minosgalanakis previously approved these changes Oct 9, 2024
Copy link
Contributor

@minosgalanakis minosgalanakis left a comment

Choose a reason for hiding this comment

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

LGTM

minosgalanakis
minosgalanakis previously approved these changes Oct 9, 2024
Copy link
Contributor

@minosgalanakis minosgalanakis left a comment

Choose a reason for hiding this comment

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

LGTM

@mpg
Copy link
Contributor

mpg commented Oct 10, 2024

@bensze01 Are the labels needs-ci and needs-work still relevant?

@mpg mpg self-requested a review October 10, 2024 08:13
@bensze01
Copy link
Contributor Author

@mpg Needs work is not, needs CI is.

@bensze01
Copy link
Contributor Author

@minosgalanakis @mpg All the CI runs have passed successfully, please (re-)review!

Copy link
Contributor

@minosgalanakis minosgalanakis left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@mpg mpg left a comment

Choose a reason for hiding this comment

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

Review in progress; next dc9d984

@@ -4,27 +4,27 @@ class BranchInfo {
/** The name of the branch */
public String branch

/* Map from component name to chosen platform to run it, or to null
* if no platform has been chosen yet. */
/** Map from component name to chosen platform to run it, or to null
Copy link
Contributor

Choose a reason for hiding this comment

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

Out of curiosity: are we running javadoc on this? If so, where's the output? If not how would we go about it?

@@ -45,6 +45,10 @@ void set_pr_environment(String target_repo, boolean is_production) {

def set_common_pr_production_environment() {
env.CHECKOUT_METHOD = 'scm'
/* The credentials here are the SSH credentials for accessing the repositories.
They are defined at {JENKINS_URL}/credentials
This is a temporary workaround, this should really be set in the Jenkins job configs */
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we have plans to remove this temporary work-around then? Is it tracked somewhere?

@@ -41,9 +41,6 @@ import net.sf.json.JSONObject
import org.mbed.tls.jenkins.BranchInfo
import org.mbed.tls.jenkins.JobTimestamps

// A static field has its content preserved across stages.
Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry if this should be obvious, but I'm not seeing how the info is preserved accross stages now that it's stored as part of BranchInfo.

Copy link
Contributor

Choose a reason for hiding this comment

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

(I can see from the test runs that it is preserved, I just can't understand how from looking at the code.)

Copy link
Contributor

@mpg mpg left a comment

Choose a reason for hiding this comment

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

LGTM, thanks! None of my questions are blockers, so I'm approving this.

@mpg mpg added approved Approved in review. May need additional CI. and removed needs: review labels Nov 5, 2024
@mpg mpg merged commit b2f594f into main Nov 5, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Approved in review. May need additional CI. priority-high size-m Estimated task size: medium (~1w)
Projects
Development

Successfully merging this pull request may close these issues.

4 participants