profile
viewpoint

iceiix/stevenarella 664

Multi-protocol Minecraft-compatible client written in Rust

mwkroening/async-stm32f1xx 17

Abstractions for asynchronous programming on the STM32F1xx family of microcontrollers.

mwkroening/badass-jlink-bom 1

Showing off an NPE when using the Badass JLink Plugin with BOMs

mwkroening/alloc-cortex-m 0

A heap allocator for Cortex-M processors

mwkroening/anbox 0

Anbox is a container-based approach to boot a full Android system on a regular GNU/Linux system

mwkroening/async-mutex 0

An async mutex

mwkroening/badass-jlink-jaxb 0

Trying to jlink JAXB

issue commenthermitcore/rusty-hermit

use criterion for the benchmarks

Hello, it's that team from UT Austin again.

We hit a bit of a wall after implementing the RISC-V bootloader, can we work on this?

Also, is this intended to completely replace the current python-based matplotlib visualizer, or should we aim to maintain support for that?

Thanks!

stlankes

comment created time in 41 minutes

PR opened kiegroup/optaplanner

Draft: PLANNER-2264: Create a PoC Gizmo Member Accessor

This is a draft of the PoC Gizmo Member Accessor. Some tests (those that use private fields without public getters) fail. Note that currently, if you use non-public fields, we use the getter of the field, which violates a guarantee we made. Reading private fields is blocked by the bytecode (even if you set the field as accessible), so for private fields, we need to use a getter (either an existing one or a created virtual one) or use the old reflection approach. <!-- Thank you for submitting this pull request.

Please provide all relevant information as outlined below. Feel free to delete a section if that type of information is not available. -->

JIRA

<!-- Add a JIRA ticket link if it exists. --> <!-- Example: https://issues.redhat.com/browse/PLANNER-1234 --> https://issues.redhat.com/browse/PLANNER-2264

Referenced pull requests

<!-- Add URLs of all referenced pull requests if they exist. This is only required when making changes that span multiple kiegroup repositories and depend on each other. --> <!-- Example:

  • https://github.com/kiegroup/droolsjbpm-build-bootstrap/pull/1234
  • https://github.com/kiegroup/drools/pull/3000
  • https://github.com/kiegroup/optaplanner/pull/899
  • etc. -->

Checklist

  • [ ] Documentation updated if applicable.
  • [ ] Upgrade recipe provided if applicable.

<details> <summary> How to retest this PR or trigger a specific build: </summary>

  • for a <b>pull request build</b> please add comment: <b>Jenkins retest this</b>
  • for a <b>full downstream build</b> please add comment: <b>Jenkins run fdb</b>
  • for a <b>compile downstream build</b> please add comment: <b>Jenkins run cdb</b>
  • for a <b>full production downstream build</b> please add comment: <b>Jenkins execute product fdb</b>
  • for an <b>upstream build</b> please add comment: <b>Jenkins run upstream</b> </details>
+473 -2

0 comment

5 changed files

pr created time in 2 hours

pull request commentMorganamilo/paru

Better error message when spawning file manager fails

I was about to do this myself after seeing the issue. One thing I didn't know at the time of writing the code was you can call '.status()' which acts as spawn and wait. With that we can just have the one error message.

Tyilo

comment created time in 2 hours

pull request commentkiegroup/optaplanner

KOGITO-3716 Allow automatic close of staging repo

Kudos, SonarCloud Quality Gate passed!

<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug.png' alt='Bug' width='16' height='16' /> <img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' /> 0 Bugs
<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability.png' alt='Vulnerability' width='16' height='16' /> <img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' /> 0 Vulnerabilities
<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot.png' alt='Security Hotspot' width='16' height='16' /> <img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' /> 0 Security Hotspots
<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell.png' alt='Code Smell' width='16' height='16' /> <img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' /> 0 Code Smells

<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/NoCoverageInfo.png' alt='No Coverage information' width='16' height='16' /> No Coverage information
<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/NoDuplicationInfo.png' alt='No Duplication information' width='16' height='16' /> No Duplication information

radtriste

comment created time in 2 hours

issue commentx-stream/xstream

XmlFriendlyNameCoder behaviour change 1.4.11.1 to 1.4.14

I guess that this is a bug caused by:

bug

sopgreg

comment created time in 2 hours

pull request commentkiegroup/optaplanner

PLANNER-2269: Make CS-B Tuple a plain data carrier

Kudos, SonarCloud Quality Gate passed!

<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug.png' alt='Bug' width='16' height='16' /> <img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' /> 0 Bugs
<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability.png' alt='Vulnerability' width='16' height='16' /> <img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' /> 0 Vulnerabilities
<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot.png' alt='Security Hotspot' width='16' height='16' /> <img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' /> 0 Security Hotspots
<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell.png' alt='Code Smell' width='16' height='16' /> <img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' /> 2 Code Smells

<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/60.png' alt='86.3%' width='16' height='16' /> 86.3% Coverage
<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/3.png' alt='0.9%' width='16' height='16' /> 0.9% Duplication

triceo

comment created time in 3 hours

issue closedMorganamilo/paru

Cant update or install AUR packages

As soon as it gets to the PKGBUILD part it return s

error: No such file or directory (os error 2)

closed time in 3 hours

TheOnAndOnlyZenomat

issue commentMorganamilo/paru

Cant update or install AUR packages

Tylio helped me get on the right track. I had to change my filemanager in the config to one that was installed. That didn't think of that. But that fixes it

TheOnAndOnlyZenomat

comment created time in 3 hours

issue commentMorganamilo/paru

Cant update or install AUR packages

I had a problem with my paru.conf where I had included the arguments for my file manager in the FileManager option and I got the same error message.

I have improved the error message in https://github.com/Morganamilo/paru/issues/95

TheOnAndOnlyZenomat

comment created time in 3 hours

Pull request review commentkiegroup/optaplanner

PLANNER-2269: Make CS-B Tuple a plain data carrier

 package org.optaplanner.core.impl.score.stream.bavet.common;  public enum BavetTupleState {-    NEW,-    CREATING,-    UPDATING,-    OK,-    DYING,-    DEAD,-    ABORTING;+    NEW(false, true),

Why is NEW not dirty?

triceo

comment created time in 3 hours

Pull request review commentkiegroup/optaplanner

PLANNER-2269: Make CS-B Tuple a plain data carrier

     private final ScoreInliner<Score_> scoreInliner;      private final Map<Class<?>, BavetFromUniNode<Object>> declaredClassToNodeMap;-    private final int nodeOrderSize;+    private final int nodeIndexSize;     private final Map<String, BavetScoringNode> constraintIdToScoringNodeMap;      private final Map<Class<?>, List<BavetFromUniNode<Object>>> effectiveClassToNodeListMap; -    private final List<Queue<BavetAbstractTuple>> nodeOrderedQueueList;+    private final List<BavetAbstractNode> nodeIndexToNodeMap;+    private final List<Queue<BavetAbstractTuple>> nodeIndexToDirtyTupleQueueMap;     private final Map<Object, List<BavetFromUniTuple<Object>>> fromTupleListMap;      public BavetConstraintSession(boolean constraintMatchEnabled, ScoreDefinition<Score_> scoreDefinition,             Map<BavetConstraint<Solution_>, Score_> constraintToWeightMap) {         this.constraintMatchEnabled = constraintMatchEnabled;-        this.zeroScore = scoreDefinition.getZeroScore();-        this.scoreInliner = scoreDefinition.buildScoreInliner(constraintMatchEnabled);+        zeroScore = scoreDefinition.getZeroScore();+        scoreInliner = scoreDefinition.buildScoreInliner(constraintMatchEnabled);         declaredClassToNodeMap = new HashMap<>(50);         BavetNodeBuildPolicy<Solution_> buildPolicy = new BavetNodeBuildPolicy<>(this, constraintToWeightMap.size());         constraintToWeightMap.forEach((constraint, constraintWeight) -> {             constraint.createNodes(buildPolicy, declaredClassToNodeMap, constraintWeight);         });-        this.nodeOrderSize = buildPolicy.getNodeOrderMaximum() + 1;+        nodeIndexSize = buildPolicy.getNodeIndexMaximum() + 1;         constraintIdToScoringNodeMap = buildPolicy.getConstraintIdToScoringNodeMap();         effectiveClassToNodeListMap = new HashMap<>(declaredClassToNodeMap.size());-        nodeOrderedQueueList = new ArrayList<>(nodeOrderSize);-        for (int i = 0; i < nodeOrderSize; i++) {-            nodeOrderedQueueList.add(new ArrayDeque<>(1000));+        nodeIndexToNodeMap = new ArrayList<>(this.nodeIndexSize);

This is not actually in use yet. The change to completely remove Node reference from Tuple seemed too invasive for this PR.

triceo

comment created time in 3 hours

PR opened kiegroup/optaplanner

Reviewers
PLANNER-2269: Make CS-B Tuple a plain data carrier
+445 -438

0 comment

57 changed files

pr created time in 3 hours

pull request commentkiegroup/optaplanner

KOGITO-3716 Allow automatic close of staging repo

Kudos, SonarCloud Quality Gate passed!

<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug.png' alt='Bug' width='16' height='16' /> <img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' /> 0 Bugs
<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability.png' alt='Vulnerability' width='16' height='16' /> <img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' /> 0 Vulnerabilities
<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot.png' alt='Security Hotspot' width='16' height='16' /> <img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' /> 0 Security Hotspots
<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell.png' alt='Code Smell' width='16' height='16' /> <img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' /> 0 Code Smells

<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/NoCoverageInfo.png' alt='No Coverage information' width='16' height='16' /> No Coverage information
<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/NoDuplicationInfo.png' alt='No Duplication information' width='16' height='16' /> No Duplication information

radtriste

comment created time in 4 hours

Pull request review commentkiegroup/optaplanner

KOGITO-3716 Allow automatic close of staging repo

 pipeline {             }             steps {                 script {-                    mavenCleanInstallOptaPlannerParents('optaplanner')-                    dir('optaplanner') {-                        maven.mvnVersionsSet(getProjectVersion())-                        updateKogitoVersion(getKogitoVersion())-                    }-                    mavenCleanInstallOptaPlannerParents('optaplanner')-                    dir('optaweb-vehicle-routing') {-                        maven.mvnVersionsUpdateParentAndChildModules(getProjectVersion())-                    }-                    dir('optaweb-employee-rostering') {-                        maven.mvnVersionsUpdateParentAndChildModules(getProjectVersion())-                    }+                    maven.mvnVersionsSet(defaultOptaplannerMvnCmd, getProjectVersion())+                    maven.mvnSetVersionProperty(defaultOptaplannerMvnCmd, 'version.org.kie.kogito', getKogitoVersion())+                    defaultOptaplannerMvnCmd.clone().skipTests(true).withOptions(['-U']).run('clean install')

updated

radtriste

comment created time in 5 hours

Pull request review commentkiegroup/optaplanner

KOGITO-3716 Allow automatic close of staging repo

 pipeline {             }             steps {                 script {-                    mavenCleanInstallOptaPlannerParents('optaplanner')-                    dir('optaplanner') {-                        maven.mvnVersionsSet(getProjectVersion())-                        updateKogitoVersion(getKogitoVersion())-                    }-                    mavenCleanInstallOptaPlannerParents('optaplanner')-                    dir('optaweb-vehicle-routing') {-                        maven.mvnVersionsUpdateParentAndChildModules(getProjectVersion())-                    }-                    dir('optaweb-employee-rostering') {-                        maven.mvnVersionsUpdateParentAndChildModules(getProjectVersion())-                    }+                    maven.mvnVersionsSet(defaultOptaplannerMvnCmd, getProjectVersion())+                    maven.mvnSetVersionProperty(defaultOptaplannerMvnCmd, 'version.org.kie.kogito', getKogitoVersion())+                    defaultOptaplannerMvnCmd.clone().skipTests(true).withOptions(['-U']).run('clean install')

woops. gonna correct that

radtriste

comment created time in 5 hours

Pull request review commentkiegroup/optaplanner

KOGITO-3716 Allow automatic close of staging repo

 pipeline {          stage('Deploy artifacts') {             steps {-                mavenDeploy('optaplanner', '-Dfull')-                mavenDeploy('optaweb-vehicle-routing', "-s ${env.GLOBAL_MAVEN_SETTINGS}")-                mavenDeploy('optaweb-employee-rostering', "-s ${env.GLOBAL_MAVEN_SETTINGS}")+                script {+                    if(!isRelease() || params.MAVEN_DEPLOY_REPOSITORY){+                        // Normal deploy+                        runMavenDeploy(defaultOptaplannerMvnCmd)+                        runMavenDeploy(defaultOptawebVehicleRoutingMvnCmd)+                        runMavenDeploy(defaultOptawebEmployeeRosteringMvnCmd)+                    } else {+                        // Deploy locally and then to staging+                        runMavenDeployLocally(defaultOptaplannerMvnCmd, optaplannerRepository)+                        runMavenDeployLocally(defaultOptawebVehicleRoutingMvnCmd, vehicleRoutingRepository)+                        runMavenDeployLocally(defaultOptawebEmployeeRosteringMvnCmd, employeeRosteringRepository)++                        runMavenStage(defaultOptaplannerMvnCmd, optaplannerRepository)+                        runMavenStage(defaultOptawebVehicleRoutingMvnCmd, vehicleRoutingRepository)+                        runMavenStage(defaultOptawebEmployeeRosteringMvnCmd, employeeRosteringRepository)

something like:

deployMavenArtifacts(defaultOptaplannerMvnCmd, optaplannerRepository)
deployMavenArtifacts(defaultOptawebVehicleRoutingMvnCmd, vehicleRoutingRepository)
deployMavenArtifacts(defaultOptawebEmployeeRosteringMvnCmd, employeeRosteringRepository)

and then

void deployMavenArtifacts(mvnCmd, directory){
    if(!isRelease() || params.MAVEN_DEPLOY_REPOSITORY){
         runMavenDeploy(mvnCmd)
    } else {
        runMavenDeployLocally(mvnCmd, directory)
        runMavenStage(mvnCmd, directory)
    }
}

?

radtriste

comment created time in 5 hours

pull request commentkiegroup/optaplanner

KOGITO-3716 Allow automatic close of staging repo

Kudos, SonarCloud Quality Gate passed!

<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug.png' alt='Bug' width='16' height='16' /> <img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' /> 0 Bugs
<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability.png' alt='Vulnerability' width='16' height='16' /> <img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' /> 0 Vulnerabilities
<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot.png' alt='Security Hotspot' width='16' height='16' /> <img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' /> 0 Security Hotspots
<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell.png' alt='Code Smell' width='16' height='16' /> <img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A.png' alt='A' width='16' height='16' /> 0 Code Smells

<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/NoCoverageInfo.png' alt='No Coverage information' width='16' height='16' /> No Coverage information
<img src='https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/NoDuplicationInfo.png' alt='No Duplication information' width='16' height='16' /> No Duplication information

radtriste

comment created time in 5 hours

issue openedx-stream/xstream

XmlFriendlyNameCoder behaviour change 1.4.11.1 to 1.4.14

Hi,

we recently updated the dependency from 1.4.11.1 to 1.4.14 and now have issues with one unit test. What happens now is, that the XmlFriendlyNameCoder replaces the '9' char and the unit test from our (forked) smooks library fails.

isXmlNameChar('9') returns false, which previously returned true. Is this the correct behaviour?

Result from the unit test is (see the 9 from 619 being replaced):

[different] Expected element tag name 'org.milyn.javabean.JIRA.MILYN__619.RootObject' but was 'org.milyn.javabean.JIRA.MILYN__61_.0039.RootObject'

grafik

created time in 6 hours

starteddanbee/persephone

started time in 7 hours

Pull request review commentkiegroup/optaplanner

KOGITO-3716 Allow automatic close of staging repo

 void commitAndCreatePRIgnoringNpmRegistry(String repo) {     commitAndCreatePR(repo) } -// TODO: move to a shared library-void addNotIgnoredPoms() {-    // based on https://stackoverflow.com/a/59888964/8811872-    sh '''-    find . -type f -name 'pom.xml' > found_poms.txt-    poms_to_add=""-    while IFS= read -r pom; do-        if ! git check-ignore -q "\$pom"; then-            poms_to_add="\$poms_to_add \$pom"-        fi-    done < found_poms.txt-    rm found_poms.txt-    git add \$poms_to_add-    git status-    '''-}+void runMavenDeploy(MavenCommand mvnCmd){+    mvnCmd= mvnCmd.clone()+    +    if(params.MAVEN_DEPLOY_REPOSITORY){
    if(params.MAVEN_DEPLOY_REPOSITORY) {
radtriste

comment created time in 8 hours

Pull request review commentkiegroup/optaplanner

KOGITO-3716 Allow automatic close of staging repo

 void installGithubCLI() {     """ } -void updateKogitoVersion(String newVersion) {-    maven.mvnSetVersionProperty('version.org.kie.kogito', newVersion)-}--boolean isSpecificMavenConfig() {-    return params.MAVEN_DEPENDENCIES_REPOSITORY != ''-}--void deployArtifacts() {-    def mvnCmd = 'clean deploy'-    if (params.MAVEN_DEPLOY_REPOSITORY) {-        mvnCmd += " -DaltDeploymentRepository=runtimes-artifacts::default::${params.MAVEN_DEPLOY_REPOSITORY} -Denforcer.skip=true"-    }--    if (isSpecificMavenConfig()) {-        runMaven(mvnCmd, true)-    } else {-        maven.runMavenWithSubmarineSettings(mvnCmd, true)+void uploadDistribution(String directory) {+    dir(directory) {+        echo "uploadDistribution for ${directory}"+        // TODO set back after testing+        // withCredentials(bindings: [sshUserPrivateKey(credentialsId: 'optaplanner-filemgmt',+        //         keyFileVariable: 'SSH_KEY_JBOSS_FILEMGMT')]) {+        //     // For testing, simulate connection via SSH:+        //     // sh "ssh -i $SSH_KEY_JBOSS_FILEMGMT -oKexAlgorithms=+diffie-hellman-group1-sha1 optaplanner@filemgmt.jboss.org"+        //     sh "./build/release/upload_distribution.sh ${getProjectVersion()} $SSH_KEY_JBOSS_FILEMGMT"+        // }     } } -void mavenCleanInstall(boolean skipTests = false, List profiles = [], String extraArgs = '') {-    runMaven('clean install', skipTests, profiles, extraArgs)-}--void runMaven(String goals, boolean skipTests = false, List profiles = [], String extraArgs = '') {-    mvnCmd = goals-    if(!profiles.isEmpty()){-        mvnCmd += " -P${profiles.join(',')}"-    }-    if (env.GLOBAL_MAVEN_ARGS != '') {-        mvnCmd += " ${env.GLOBAL_MAVEN_ARGS}"-    }-    if(extraArgs != ''){-        mvnCmd += " ${extraArgs}"+MavenCommand getMavenConfig() {+    mvnCmd = new MavenCommand(this, ['-fae'])+                    .withSettingsXmlId(params.MAVEN_SETTINGS_CONFIG_FILE_ID)+    if (params.MAVEN_DEPENDENCIES_REPOSITORY) {+        mvnCmd.withDependencyRepositoryInSettings('deps-repo', params.MAVEN_DEPENDENCIES_REPOSITORY)     }-    maven.runMaven(mvnCmd, skipTests, ['-fae'])+    return mvnCmd } -void uploadDistribution() {-    withCredentials(bindings: [sshUserPrivateKey(credentialsId: 'optaplanner-filemgmt',-            keyFileVariable: 'SSH_KEY_JBOSS_FILEMGMT')]) {-        // For testing, simulate connection via SSH:-        // sh "ssh -i $SSH_KEY_JBOSS_FILEMGMT -oKexAlgorithms=+diffie-hellman-group1-sha1 optaplanner@filemgmt.jboss.org"-        sh "./build/release/upload_distribution.sh ${getProjectVersion()} $SSH_KEY_JBOSS_FILEMGMT"+void runMavenDeploy(MavenCommand mvnCmd){
void runMavenDeploy(MavenCommand mvnCmd) {
radtriste

comment created time in 7 hours

Pull request review commentkiegroup/optaplanner

KOGITO-3716 Allow automatic close of staging repo

 void commitAndCreatePRIgnoringNpmRegistry(String repo) {     commitAndCreatePR(repo) } -// TODO: move to a shared library-void addNotIgnoredPoms() {-    // based on https://stackoverflow.com/a/59888964/8811872-    sh '''-    find . -type f -name 'pom.xml' > found_poms.txt-    poms_to_add=""-    while IFS= read -r pom; do-        if ! git check-ignore -q "\$pom"; then-            poms_to_add="\$poms_to_add \$pom"-        fi-    done < found_poms.txt-    rm found_poms.txt-    git add \$poms_to_add-    git status-    '''-}+void runMavenDeploy(MavenCommand mvnCmd){
void runMavenDeploy(MavenCommand mvnCmd) {
radtriste

comment created time in 8 hours

Pull request review commentkiegroup/optaplanner

KOGITO-3716 Allow automatic close of staging repo

 pipeline {          stage('Deploy artifacts') {             steps {-                mavenDeploy('optaplanner', '-Dfull')-                mavenDeploy('optaweb-vehicle-routing', "-s ${env.GLOBAL_MAVEN_SETTINGS}")-                mavenDeploy('optaweb-employee-rostering', "-s ${env.GLOBAL_MAVEN_SETTINGS}")+                script {+                    if(!isRelease() || params.MAVEN_DEPLOY_REPOSITORY){
                    if(!isRelease() || params.MAVEN_DEPLOY_REPOSITORY) {
radtriste

comment created time in 8 hours

Pull request review commentkiegroup/optaplanner

KOGITO-3716 Allow automatic close of staging repo

 void commitAndCreatePRIgnoringNpmRegistry(String repo) {     commitAndCreatePR(repo) } -// TODO: move to a shared library-void addNotIgnoredPoms() {-    // based on https://stackoverflow.com/a/59888964/8811872-    sh '''-    find . -type f -name 'pom.xml' > found_poms.txt-    poms_to_add=""-    while IFS= read -r pom; do-        if ! git check-ignore -q "\$pom"; then-            poms_to_add="\$poms_to_add \$pom"-        fi-    done < found_poms.txt-    rm found_poms.txt-    git add \$poms_to_add-    git status-    '''-}+void runMavenDeploy(MavenCommand mvnCmd){+    mvnCmd= mvnCmd.clone()+    +    if(params.MAVEN_DEPLOY_REPOSITORY){+        mvnCmd.withDeployRepository(params.MAVEN_DEPLOY_REPOSITORY)+    } -void mavenCleanInstall(String directory, boolean skipTests = false, List profiles = [], String extraArgs = '') {-    runMaven('clean install', directory, skipTests, profiles, extraArgs)+    mvnCmd.skipTests(true).run('clean deploy') } -/**- * Builds the parent modules and the BOM so that project depending on these artifacts can resolve.- */-void mavenCleanInstallOptaPlannerParents(String directory) {-    mavenCleanInstall(directory, true, [], '-pl org.optaplanner:optaplanner-build-parent,org.optaplanner:optaplanner-bom -am')+void runMavenDeployLocally(MavenCommand mvnCmd, String localDeployId) {+    mvnCmd.clone()+        .skipTests(true)+        .withLocalDeployFolder(getLocalDeploymentFolder(localDeployId))+        .run('clean deploy') } -void mavenDeploy(String directory, extraArgs = '') {-    String deployRepoArgs = params.MAVEN_DEPLOY_REPOSITORY != '' ? "-DaltDeploymentRepository=runtimes-artifacts::default::${params.MAVEN_DEPLOY_REPOSITORY} -Denforcer.skip=true" : ''-    String resolvedArgs = "$extraArgs $deployRepoArgs".trim()-    runMaven('clean deploy', directory, true, [], resolvedArgs)+void runMavenStage(MavenCommand mvnCmd, String localDeployId) {+    MavenStagingHelper stagingHelper = getStagingHelper(mvnCmd)+    deployProperties.putAll(stagingHelper.stageLocalArtifacts(params.NEXUS_STAGING_PROFILE_ID, getLocalDeploymentFolder(localDeployId)))+    stagingHelper.promoteStagingRepository(params.NEXUS_BUILD_PROMOTION_PROFILE_ID) } -void runMaven(String goals, String directory, boolean skipTests = false, List profiles = [], String extraArgs = '') {-    mvnCmd = goals-    if(!profiles.isEmpty()){-        mvnCmd += " -P${profiles.join(',')}"-    }-    if(extraArgs != ''){-        mvnCmd += " ${extraArgs}"-    }-    dir(directory) {-        maven.runMaven(mvnCmd, skipTests, ['-fae'])-    }+MavenStagingHelper getStagingHelper(MavenCommand mvnCmd) {+    return new MavenStagingHelper(this, mvnCmd)+                .withNexusReleaseUrl(params.NEXUS_RELEASE_URL)+                .withNexusReleaseRepositoryId(params.NEXUS_RELEASE_REPOSITORY_ID) } -void updateKogitoVersion(String newVersion) {-    maven.mvnSetVersionProperty('version.org.kie.kogito', newVersion)+String getLocalDeploymentFolder(String localDeployId){
String getLocalDeploymentFolder(String localDeployId) {
radtriste

comment created time in 8 hours

Pull request review commentkiegroup/optaplanner

KOGITO-3716 Allow automatic close of staging repo

 void commitAndCreatePRIgnoringNpmRegistry(String repo) {     commitAndCreatePR(repo) } -// TODO: move to a shared library-void addNotIgnoredPoms() {-    // based on https://stackoverflow.com/a/59888964/8811872-    sh '''-    find . -type f -name 'pom.xml' > found_poms.txt-    poms_to_add=""-    while IFS= read -r pom; do-        if ! git check-ignore -q "\$pom"; then-            poms_to_add="\$poms_to_add \$pom"-        fi-    done < found_poms.txt-    rm found_poms.txt-    git add \$poms_to_add-    git status-    '''-}

Thank you!

radtriste

comment created time in 8 hours

Pull request review commentkiegroup/optaplanner

KOGITO-3716 Allow automatic close of staging repo

 pipeline {          stage('Deploy artifacts') {             steps {-                mavenDeploy('optaplanner', '-Dfull')-                mavenDeploy('optaweb-vehicle-routing', "-s ${env.GLOBAL_MAVEN_SETTINGS}")-                mavenDeploy('optaweb-employee-rostering', "-s ${env.GLOBAL_MAVEN_SETTINGS}")+                script {+                    if(!isRelease() || params.MAVEN_DEPLOY_REPOSITORY){+                        // Normal deploy+                        runMavenDeploy(defaultOptaplannerMvnCmd)+                        runMavenDeploy(defaultOptawebVehicleRoutingMvnCmd)+                        runMavenDeploy(defaultOptawebEmployeeRosteringMvnCmd)+                    } else {+                        // Deploy locally and then to staging+                        runMavenDeployLocally(defaultOptaplannerMvnCmd, optaplannerRepository)+                        runMavenDeployLocally(defaultOptawebVehicleRoutingMvnCmd, vehicleRoutingRepository)+                        runMavenDeployLocally(defaultOptawebEmployeeRosteringMvnCmd, employeeRosteringRepository)++                        runMavenStage(defaultOptaplannerMvnCmd, optaplannerRepository)+                        runMavenStage(defaultOptawebVehicleRoutingMvnCmd, vehicleRoutingRepository)+                        runMavenStage(defaultOptawebEmployeeRosteringMvnCmd, employeeRosteringRepository)

The if-else can be replaced by a method, e.g. deployMavenArtifacts() that would take care of a single repository.

radtriste

comment created time in 8 hours

Pull request review commentkiegroup/optaplanner

KOGITO-3716 Allow automatic close of staging repo

 pipeline {          stage('Clone repositories') {             steps {-                checkoutRepo('optaplanner', getBuildBranch())-                checkoutRepo('optaplanner-quickstarts', getQuickStartsBranch())-                checkoutRepo('optaweb-vehicle-routing', getBuildBranch())-                checkoutRepo('optaweb-employee-rostering', getBuildBranch())+                checkoutRepo(optaplannerRepository, getBuildBranch())

Thanks, I wanted to do some refactoring, including this change, after your PRs.

radtriste

comment created time in 8 hours

Pull request review commentkiegroup/optaplanner

KOGITO-3716 Allow automatic close of staging repo

 pipeline {             }             steps {                 script {-                    mavenCleanInstallOptaPlannerParents('optaplanner')-                    dir('optaplanner') {-                        maven.mvnVersionsSet(getProjectVersion())-                        updateKogitoVersion(getKogitoVersion())-                    }-                    mavenCleanInstallOptaPlannerParents('optaplanner')-                    dir('optaweb-vehicle-routing') {-                        maven.mvnVersionsUpdateParentAndChildModules(getProjectVersion())-                    }-                    dir('optaweb-employee-rostering') {-                        maven.mvnVersionsUpdateParentAndChildModules(getProjectVersion())-                    }+                    maven.mvnVersionsSet(defaultOptaplannerMvnCmd, getProjectVersion())+                    maven.mvnSetVersionProperty(defaultOptaplannerMvnCmd, 'version.org.kie.kogito', getKogitoVersion())+                    defaultOptaplannerMvnCmd.clone().skipTests(true).withOptions(['-U']).run('clean install')

The mavenCleanInstallOptaPlannerParents ran only specific modules (a parent pom.xml and BOM) the other projects depend upon to save time (a couple of seconds vs. ~5 minutes). I don't expect these two modules to be renamed; especially the BOM is a part of our API.

radtriste

comment created time in 8 hours

Pull request review commentkiegroup/optaplanner

KOGITO-3716 Allow automatic close of staging repo

 pipeline {                         assert getProjectVersion() != ''                         assert getKogitoVersion() != ''                     }++                    // Setup Maven config+                    // Create a default command with default config and which will be cloned for projects+                    MavenCommand defaultMvnCmd = new MavenCommand(this, ['-fae'])+                                                    .withSettingsXmlId(params.MAVEN_SETTINGS_CONFIG_FILE_ID)+                    if (params.MAVEN_DEPENDENCIES_REPOSITORY) {+                        defaultMvnCmd.withDependencyRepositoryInSettings('deps-repo', params.MAVEN_DEPENDENCIES_REPOSITORY)+                    }++                    // Setup maven default commands+                    defaultOptaplannerMvnCmd = defaultMvnCmd.clone().inDirectory(optaplannerRepository).withProperty('full')

I am slightly in favor of the getMavenConfig (or getDefaultMavenConfig in this case?) as pointed here https://github.com/kiegroup/kogito-examples/pull/435#discussion_r534060546

radtriste

comment created time in 8 hours

more