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

check crd generator #876

Closed
wants to merge 24 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
4e52afe
chore: rebase on main, keep version intact to reduce distance with main
metacosm Jul 7, 2023
5124750
chore: update to proper next fabric8 version
metacosm Nov 9, 2023
83521a9
chore: re-add snapshot repositories (NOT TO BE MERGED IN MAIN)
metacosm Nov 20, 2023
a7ebe73
fix: move fabric8 override to BOM
metacosm Jan 9, 2024
5383313
fix: add Quarkus snapshots repository
metacosm Jan 10, 2024
e4f445d
fix: move repository declarations to parent
metacosm Jan 10, 2024
00596fe
fix: add plugin repository for Quarkus snapshots
metacosm Jan 10, 2024
668d206
feat: add dependency check step on failure
metacosm Jan 10, 2024
4814276
fix: use Quarkus 3.7.1
metacosm Jan 10, 2024
5ce2184
chore: update to Fabric8 client to 6.11
metacosm Jan 22, 2024
1b95a44
chore(build): remove now unneeded repository configurations
metacosm Jan 24, 2024
5050cb0
chore: update to Fabric8 6.12-SNAPSHOT
metacosm Mar 27, 2024
273ee8f
feat: make it possible to build from a fabric8 client PR
metacosm Apr 29, 2024
f1254af
fix: make Quarkus and Fabric8 client PR numbers optional
metacosm Apr 29, 2024
521d127
fix: properly update FKC version
metacosm Apr 29, 2024
c0e303c
fix: retrieve latest Quarkus version from registry by default
metacosm Apr 29, 2024
ca490c4
wip: meant to test fabric8io/kubernetes-client#5949
metacosm Apr 30, 2024
bf728d9
fix: change fabric8 version as soon as PR is built if needed
metacosm Apr 30, 2024
334d7ec
fix: should use existing version
metacosm Apr 30, 2024
1a9c187
fix: change versions after profiles have been set
metacosm Apr 30, 2024
9d15aa6
fix: change f8 version before anything else for new deps to resolve
metacosm Apr 30, 2024
fcefa02
fix: properly use profiles
metacosm Apr 30, 2024
c8bff6c
fix: typo
metacosm Apr 30, 2024
26f5914
fix: change f8 version using sed instead of mvn
metacosm Apr 30, 2024
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
41 changes: 40 additions & 1 deletion .github/workflows/build-for-quarkus-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ on:
workflow_call:
inputs:
quarkus-version-jq-cmd:
description: 'jq command to extract which Quarkus version to use from https://registry.quarkus.io/client/platforms'
type: string
required: false
quarkus-version:
Expand All @@ -30,14 +31,23 @@ on:
default: 'default'
workflow_dispatch:
inputs:
quarkus-version-jq-cmd:
description: 'jq command to extract which Quarkus version to use from https://registry.quarkus.io/client/platforms'
type: string
required: false
default: '.platforms[0]."current-stream-id" as $current | .platforms[0].streams[] | select(.id == $current) | .releases[0].version'
josdk-pr:
description: 'JOSDK PR number (or main) to use to build QOSDK with'
type: string
required: false
quarkus-pr:
description: 'Quarkus PR number to use to run a QOSDK build with'
type: string
required: true
required: false
fkc-pr:
description: 'Fabric8 client PR number to use to run a QOSDK build with'
type: string
required: false
java-version:
description: 'Java version to build with'
type: string
Expand Down Expand Up @@ -123,6 +133,25 @@ jobs:
mvn -Dquickly
cd -

- name: Check-out Fabric8 client PR if requested
uses: actions/checkout@v4
if: "${{ inputs.fkc-pr != '' }}"
with:
repository: fabric8io/kubernetes-client
path: fkc

- name: Build Fabric8 client PR if requested
if: "${{ inputs.fkc-pr != '' }}"
id: build-fkc-pr
run: |
cd fkc
git fetch origin pull/${{ github.event.inputs.fkc-pr }}/head:pr-to-check
git switch pr-to-check
mvn versions:set -DnewVersion=999.${{ github.event.inputs.fkc-pr }}-SNAPSHOT versions:commit
echo "f8_pr_version=$(mvn help:evaluate -Dexpression=project.version -q -DforceStdout)" >> $GITHUB_OUTPUT
mvn clean install -DskipTests
cd -

- name: Retrieve Quarkus version from platform
if: "${{ inputs.quarkus-version == '' && inputs.quarkus-pr == ''}}"
id: get-quarkus-version
Expand Down Expand Up @@ -155,6 +184,12 @@ jobs:
echo "Computed Maven profiles: ${maven_profiles}"
echo "maven_profiles=${maven_profiles}" >> $GITHUB_OUTPUT

- name: Change Fabric8 client version
if: "${{ inputs.fkc-pr != '' }}"
run: |
echo "Using Fabric8 ${{ steps.build-fkc-pr.outputs.f8_pr_version }}"
sed -r -i "s@<fabric8-client.version>[^<]+</fabric8-client.version>@<fabric8-client.version>${{ steps.build-fkc-pr.outputs.f8_pr_version }}</fabric8-client.version>@" bom/pom.xml

- name: Change Quarkus version
run: |
echo "Using Quarkus ${{ steps.quarkus-version.outputs.quarkus_version }}"
Expand All @@ -172,6 +207,10 @@ jobs:
- name: Build with Maven (JVM)
run: mvn -B formatter:validate install -P'${{steps.set-mvn-profiles.outputs.maven_profiles}}' --file pom.xml

- name: Dependency tree on failure
if: failure()
run: mvn -B dependency:tree -Dverbose

- name: Kubernetes KinD Cluster
uses: container-tools/kind-action@v2
with:
Expand Down
8 changes: 6 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
name: Build PRs and main when updated

on:
schedule:
# daily run
- cron: '0 0 * * *'
push:
branches:
- "main"
- "next-fabric8-version"
paths-ignore:
- '.gitignore'
- 'CODEOWNERS'
Expand Down Expand Up @@ -83,7 +86,8 @@ jobs:
java-version: [ 17, 21 ]
uses: ./.github/workflows/build-for-quarkus-version.yml
with:
quarkus-version: ${{ needs.extract-project-metadata.outputs.latest_stable_quarkus }}
# quarkus-version: ${{ needs.extract-project-metadata.outputs.latest_stable_quarkus }}
quarkus-version: 999-SNAPSHOT
java-version: ${{ matrix.java-version }}
branch: ${{ needs.extract-project-metadata.outputs.branch_name }}
native-modules: "integration-tests"
Expand Down
11 changes: 11 additions & 0 deletions bom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,19 @@
<url>https://github.com/quarkiverse/quarkus-operator-sdk/issues/</url>
</issueManagement>

<properties>
<fabric8-client.version>6.12-SNAPSHOT</fabric8-client.version>
</properties>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>io.fabric8</groupId>
<artifactId>kubernetes-client-bom</artifactId>
<version>${fabric8-client.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>io.quarkus</groupId>
<artifactId>quarkus-bom</artifactId>
Expand Down
1 change: 1 addition & 0 deletions build-parent/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
</properties>

<dependencyManagement>
<dependencies>
<dependency>
Expand Down
2 changes: 1 addition & 1 deletion core/deployment/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
</dependency>
<dependency>
<groupId>io.fabric8</groupId>
<artifactId>crd-generator-api</artifactId>
<artifactId>crd-generator-api-v2</artifactId>
</dependency>
<dependency>
<groupId>org.semver4j</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@

import org.jboss.logging.Logger;

import io.fabric8.crd.generator.CRDGenerator;
import io.fabric8.crd.generator.CustomResourceInfo;
import io.fabric8.crdv2.generator.CRDGenerator;
import io.fabric8.crdv2.generator.CustomResourceInfo;
import io.fabric8.kubernetes.client.CustomResource;
import io.quarkiverse.operatorsdk.common.CustomResourceAugmentedClassInfo;
import io.quarkiverse.operatorsdk.common.FileUtils;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ public Map<String, ResourceInfo> getResourceInfos(String resourceFullName) {
return infos;
}

public void add(io.fabric8.crd.generator.CustomResourceInfo info, String crdName, String associatedControllerName) {
public void add(io.fabric8.crdv2.generator.CustomResourceInfo info, String crdName, String associatedControllerName) {
final var version = info.version();
final var versionsForCR = resourceFullNameToVersionToInfos.computeIfAbsent(crdName, s -> new HashMap<>());
final var cri = versionsForCR.get(version);
Expand All @@ -41,7 +41,7 @@ public void add(io.fabric8.crd.generator.CustomResourceInfo info, String crdName
versionsForCR.put(version, converted);
}

private static ResourceInfo augment(io.fabric8.crd.generator.CustomResourceInfo info,
private static ResourceInfo augment(io.fabric8.crdv2.generator.CustomResourceInfo info,
String crdName, String associatedControllerName) {
return new ResourceInfo(
info.group(), info.version(), info.kind(), info.singular(), info.plural(), info.shortNames(),
Expand Down
Loading