Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions .github/actions/incremental-build/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -31,16 +31,20 @@ inputs:
description: 'Flag indicating whether the installation of mvnd should be skipped'
required: false
default: 'false'
github-repo:
description: 'The GitHub repository name (example, apache/camel)'
required: false
default: 'apache/camel'
runs:
using: "composite"
steps:
- id: install-mvnd
uses: ./.github/actions/install-mvnd
uses: apache/camel/.github/actions/install-mvnd@main
with:
dry-run: ${{ inputs.skip-mvnd-install }}
- name: maven build
shell: bash
run: ${{ github.action_path }}/incremental-build.sh ${{ steps.install-mvnd.outputs.mvnd-dir }}/mvnd ${{ inputs.mode }} ${{ inputs.pr-id }}
run: ${{ github.action_path }}/incremental-build.sh ${{ steps.install-mvnd.outputs.mvnd-dir }}/mvnd ${{ inputs.mode }} ${{ inputs.pr-id }} ${{ inputs.github-repo }}
env:
GITHUB_TOKEN: ${{ inputs.github-token }}
- name: archive logs
Expand Down
14 changes: 8 additions & 6 deletions .github/actions/incremental-build/incremental-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -37,11 +37,12 @@ function findProjectRoot () {
function hasLabel() {
local issueNumber=${1}
local label="incremental-${2}"
local repository=${3}
curl -s \
-H "Accept: application/vnd.github+json" \
-H "Authorization: Bearer ${GITHUB_TOKEN}"\
-H "X-GitHub-Api-Version: 2022-11-28" \
"https://api.github.com/repos/apache/camel/issues/${issueNumber}/labels" | jq -r '.[].name' | grep -c "$label"
"https://api.github.com/repos/${repository}/issues/${issueNumber}/labels" | jq -r '.[].name' | grep -c "$label"
}

function main() {
Expand All @@ -50,10 +51,11 @@ function main() {
local log="incremental-${mode}.log"
local prId=${3}
local ret=0
local repository=${4}

echo "Searching for affected projects"
local projects
projects=$(curl -s "https://patch-diff.githubusercontent.com/raw/apache/camel/pull/${prId}.diff" | sed -n -e '/^diff --git a/p' | awk '{print $3}' | cut -b 3- | sed 's|\(.*\)/.*|\1|' | uniq | sort)
projects=$(curl -s "https://patch-diff.githubusercontent.com/raw/${repository}/pull/${prId}.diff" | sed -n -e '/^diff --git a/p' | awk '{print $3}' | cut -b 3- | sed 's|\(.*\)/.*|\1|' | uniq | sort)
local pl=""
local lastProjectRoot=""
local buildAll=false
Expand Down Expand Up @@ -87,7 +89,7 @@ function main() {

if [[ ${mode} = "build" ]] ; then
local mustBuildAll
mustBuildAll=$(hasLabel ${prId} "build-all")
mustBuildAll=$(hasLabel ${prId} "build-all" ${repository})
if [[ ${mustBuildAll} = "1" ]] ; then
echo "The build-all label has been detected thus all projects must be built"
buildAll=true
Expand All @@ -98,7 +100,7 @@ function main() {
ret=$?
else
local buildDependents
buildDependents=$(hasLabel ${prId} "build-dependents")
buildDependents=$(hasLabel ${prId} "build-dependents" ${repository})
local totalTestableProjects
if [[ ${buildDependents} = "1" ]] ; then
echo "The build-dependents label has been detected thus the projects that depend on the affected projects will be built"
Expand All @@ -119,15 +121,15 @@ function main() {
[[ -z $(git status --porcelain | grep -v antora.yml) ]] || { echo 'There are uncommitted changes'; git status; echo; echo; git diff; exit 1; }
else
local mustSkipTests
mustSkipTests=$(hasLabel ${prId} "skip-tests")
mustSkipTests=$(hasLabel ${prId} "skip-tests" ${repository})
if [[ ${mustSkipTests} = "1" ]] ; then
echo "The skip-tests label has been detected thus no test will be launched"
buildAll=true
elif [[ ${buildAll} = "true" ]] ; then
echo "Cannot launch the tests of all projects, so no test will be launched"
else
local testDependents
testDependents=$(hasLabel ${prId} "test-dependents")
testDependents=$(hasLabel ${prId} "test-dependents" ${repository})
local totalTestableProjects
if [[ ${testDependents} = "1" ]] ; then
echo "The test-dependents label has been detected thus the projects that depend on affected projects will be tested"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,11 @@

import org.apache.camel.CamelContext;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.parallel.Isolated;

import static org.junit.jupiter.api.Assertions.*;

@Isolated("This test is regularly flaky")
public class FilterParametersTest extends AbstractJsseParametersTest {

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,9 +27,11 @@
import org.apache.camel.CamelContext;
import org.apache.camel.impl.DefaultCamelContext;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.parallel.Isolated;

import static org.junit.jupiter.api.Assertions.*;

@Isolated("This test is regularly flaky")
public class KeyManagersParametersTest extends AbstractJsseParametersTest {

protected KeyStoreParameters createMinimalKeyStoreParameters() {
Expand Down Expand Up @@ -63,7 +65,7 @@ public void testPropertyPlaceholders() throws Exception {
ksp.setType("{{keyStoreParameters.type}}");
ksp.setProvider("{{keyStoreParameters.provider}}");
ksp.setResource("{{keyStoreParameters.resource}}");
ksp.setPassword("{{keyStoreParamerers.password}}");
ksp.setPassword("{{keyStoreParameters.password}}");

KeyManagersParameters kmp = new KeyManagersParameters();
kmp.setCamelContext(context);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public void testPropertyPlaceholders() throws Exception {
ksp.setType("{{keyStoreParameters.type}}");
ksp.setProvider("{{keyStoreParameters.provider}}");
ksp.setResource("{{keyStoreParameters.resource}}");
ksp.setPassword("{{keyStoreParamerers.password}}");
ksp.setPassword("{{keyStoreParameters.password}}");

KeyStore ks = ksp.createKeyStore();
assertNotNull(ks.getCertificate("localhost"));
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,11 @@

import org.apache.camel.CamelContext;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.parallel.Isolated;

import static org.junit.jupiter.api.Assertions.*;

@Isolated("This test is regularly flaky")
public class SSLContextParametersTest extends AbstractJsseParametersTest {

@Test
Expand Down Expand Up @@ -68,7 +70,7 @@ public void testPropertyPlaceholders() throws Exception {
ksp.setType("{{keyStoreParameters.type}}");
ksp.setProvider("{{keyStoreParameters.provider}}");
ksp.setResource("{{keyStoreParameters.resource}}");
ksp.setPassword("{{keyStoreParamerers.password}}");
ksp.setPassword("{{keyStoreParameters.password}}");

KeyManagersParameters kmp = new KeyManagersParameters();
kmp.setCamelContext(camelContext);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,12 @@

import org.apache.camel.CamelContext;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.parallel.Isolated;

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.fail;

@Isolated("This test is regularly flaky")
public class SecureRandomParametersTest extends AbstractJsseParametersTest {

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,12 @@
import org.apache.camel.impl.DefaultCamelContext;
import org.junit.jupiter.api.Test;
import org.junit.jupiter.api.condition.DisabledIfSystemProperty;
import org.junit.jupiter.api.parallel.Isolated;

import static org.junit.jupiter.api.Assertions.*;

@DisabledIfSystemProperty(named = "ci.env.name", matches = "github.com", disabledReason = "Flaky on Github CI")
@Isolated("This test is regularly flaky")
public class TrustManagersParametersTest extends AbstractJsseParametersTest {

protected KeyStoreParameters createMinimalKeyStoreParameters() {
Expand Down Expand Up @@ -61,7 +63,7 @@ public void testPropertyPlaceholders() throws Exception {
ksp.setType("{{keyStoreParameters.type}}");
ksp.setProvider("{{keyStoreParameters.provider}}");
ksp.setResource("{{keyStoreParameters.resource}}");
ksp.setPassword("{{keyStoreParamerers.password}}");
ksp.setPassword("{{keyStoreParameters.password}}");

TrustManagersParameters tmp = new TrustManagersParameters();
tmp.setCamelContext(context);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ filterParameters.include=include
filterParameters.exclude=exclude

keyStoreParameters.resource=org/apache/camel/support/jsse/localhost.p12
keyStoreParamerers.password=changeit
keyStoreParameters.password=changeit

keyManagersParameters.keyPassword=changeit

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,4 +14,4 @@
## See the License for the specific language governing permissions and
## limitations under the License.
## ---------------------------------------------------------------------------
mongodb.container=mongo:7.0.4-jammy
mongodb.container=mongo:7.0.9-jammy