Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/github_actions/actions/upload-art…
Browse files Browse the repository at this point in the history
…ifact-3.1.3
  • Loading branch information
leninmehedy authored Oct 4, 2023
2 parents 6388392 + 6a29222 commit 378be41
Show file tree
Hide file tree
Showing 66 changed files with 1,421 additions and 366 deletions.
31 changes: 30 additions & 1 deletion .github/workflows/zxc-compile-code.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ jobs:
uses: helm/kind-action@dda0770415bac9fc20092cacbc54aa298604d140 # v1.8.0
if: ${{ inputs.enable-unit-tests && !cancelled() }}
with:
cluster_name: fst
config: dev/dev-cluster.yaml
version: v0.19.0
verbosity: 3
wait: 120s
Expand All @@ -125,6 +125,7 @@ jobs:
run: |
kubectl config get-contexts
kubectl get crd
kubectl get node --show-labels
# This step is currently required because the Hedera Services artifacts are not publicly accessible.
# May be removed once the artifacts are publicly accessible.
Expand Down Expand Up @@ -162,13 +163,31 @@ jobs:
gradle-version: ${{ inputs.gradle-version }}
arguments: assemble --scan

- name: Examples Compile
id: gradle-build-examples
uses: gradle/gradle-build-action@243af859f8ca30903d9d7f7936897ca0358ba691 # v2.7.1
with:
gradle-version: ${{ inputs.gradle-version }}
arguments: assemble --scan
build-root-directory: fullstack-examples
gradle-executable: gradlew

- name: Spotless Check
uses: gradle/gradle-build-action@243af859f8ca30903d9d7f7936897ca0358ba691 # v2.7.1
if: ${{ inputs.enable-spotless-check && steps.gradle-build.conclusion == 'success' && !cancelled() }}
with:
gradle-version: ${{ inputs.gradle-version }}
arguments: spotlessCheck --scan

- name: Examples Spotless Check
uses: gradle/gradle-build-action@243af859f8ca30903d9d7f7936897ca0358ba691 # v2.7.1
if: ${{ inputs.enable-spotless-check && steps.gradle-build-examples.conclusion == 'success' && !cancelled() }}
with:
gradle-version: ${{ inputs.gradle-version }}
arguments: spotlessCheck --scan
build-root-directory: fullstack-examples
gradle-executable: gradlew

- name: Unit Tests
id: gradle-test
uses: gradle/gradle-build-action@243af859f8ca30903d9d7f7936897ca0358ba691 # v2.7.1
Expand All @@ -177,6 +196,16 @@ jobs:
gradle-version: ${{ inputs.gradle-version }}
arguments: check --scan

- name: Examples Unit Tests
id: gradle-test-examples
uses: gradle/gradle-build-action@243af859f8ca30903d9d7f7936897ca0358ba691 # v2.7.1
if: ${{ inputs.enable-unit-tests && steps.gradle-build-examples.conclusion == 'success' && !cancelled() && !failure() }}
with:
gradle-version: ${{ inputs.gradle-version }}
arguments: check --scan
build-root-directory: fullstack-examples
gradle-executable: gradlew

- name: Publish Unit Test Report
uses: actionite/publish-unit-test-result-action@1e01e49081c6c4073913aa4b7980fa83e709f322 # v2.3.0
if: ${{ inputs.enable-unit-tests && steps.gradle-build.conclusion == 'success' && !cancelled() && !failure() }}
Expand Down
2 changes: 1 addition & 1 deletion build-logic/project-plugins/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ dependencies {
implementation("com.autonomousapps:dependency-analysis-gradle-plugin:1.20.0")
implementation("org.gradlex:extra-java-module-info:1.4")
implementation("org.gradlex:java-ecosystem-capabilities:1.1")
implementation("org.gradlex:java-module-dependencies:1.3")
implementation("org.gradlex:java-module-dependencies:1.4.1")

implementation("com.diffplug.spotless:spotless-plugin-gradle:6.18.0")
implementation("org.sonarsource.scanner.gradle:sonarqube-gradle-plugin:4.0.0.2929")
Expand Down
24 changes: 24 additions & 0 deletions build-logic/project-plugins/src/main/kotlin/Utils.kt
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,30 @@ class Utils {
updateStringInFile(manifestFile, "appVersion:", "appVersion: \"${newVersion}\"")
}

@JvmStatic
fun updateHelmChartVersion(project: Project, newVersion: SemVer) {
updateHelmCharts(project) {chart ->
updateHelmChartVersion(project, chart.name, newVersion)
}
}

@JvmStatic
fun updateHelmChartAppVersion(project: Project, newVersion: SemVer) {
updateHelmCharts(project) {chart ->
updateHelmChartAppVersion(project, chart.name, newVersion)
}
}

@JvmStatic
fun updateHelmCharts(project: Project, fn: (File) -> Unit) {
val chartDir = File(project.rootProject.projectDir, "charts")
chartDir.listFiles()?.forEach { chart ->
if (chart.isDirectory && File(chart, "Chart.yaml").exists()) {
fn(chart)
}
}
}

private fun updateStringInFile(file: File, startsWith: String, newString: String, ignoreLeadingSpace: Boolean = true) {
var lines: List<String> = mutableListOf()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,17 +50,15 @@ tasks.register("githubVersionSummary") {
}
}

val HEDERA_NETWORK_CHART = "hedera-network"

tasks.register("versionAsSpecified") {
group = "versioning"
doLast {
val verStr = findProperty("newVersion")?.toString()
?: throw IllegalArgumentException("No newVersion property provided! Please add the parameter -PnewVersion=<version> when running this task.")

val newVer = SemVer.parse(verStr)
Utils.updateHelmChartVersion(project, HEDERA_NETWORK_CHART, newVer)
Utils.updateHelmChartAppVersion(project, HEDERA_NETWORK_CHART, newVer)
Utils.updateHelmChartVersion(project, newVer)
Utils.updateHelmChartAppVersion(project, newVer)
Utils.updateVersion(project, newVer)
}
}
Expand All @@ -71,8 +69,8 @@ tasks.register("versionAsSnapshot") {
val currVer = SemVer.parse(project.version.toString())
val newVer = SemVer(currVer.major, currVer.minor, currVer.patch, "SNAPSHOT")

Utils.updateHelmChartVersion(project, HEDERA_NETWORK_CHART, newVer)
Utils.updateHelmChartAppVersion(project, HEDERA_NETWORK_CHART, newVer)
Utils.updateHelmChartVersion(project, newVer)
Utils.updateHelmChartAppVersion(project, newVer)
Utils.updateVersion(project, newVer)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,6 @@ plugins {
}

javaModuleDependencies {
versionsFromConsistentResolution(":fullstack-helm-client")

moduleNameToGA.put("com.hedera.fullstack.junit.support", "com.hedera.fullstack:fullstack-junit-support")
moduleNameToGA.put("com.hedera.fullstack.test.toolkit", "com.hedera.fullstack:fullstack-test-toolkit")
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/*
* Copyright 2023 Hedera Hashgraph, LLC
*
* This software is the confidential and proprietary information of
* Hedera Hashgraph, LLC. ("Confidential Information"). You shall not
* disclose such Confidential Information and shall use it only in
* accordance with the terms of the license agreement you entered into
* with Hedera Hashgraph.
*
* HEDERA HASHGRAPH MAKES NO REPRESENTATIONS OR WARRANTIES ABOUT THE SUITABILITY OF
* THE SOFTWARE, EITHER EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED
* TO THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A
* PARTICULAR PURPOSE, OR NON-INFRINGEMENT. HEDERA HASHGRAPH SHALL NOT BE LIABLE FOR
* ANY DAMAGES SUFFERED BY LICENSEE AS A RESULT OF USING, MODIFYING OR
* DISTRIBUTING THIS SOFTWARE OR ITS DERIVATIVES.
*/

plugins {
id("com.autonomousapps.dependency-analysis")
id("com.hedera.fullstack.aggregate-reports")
id("com.hedera.fullstack.spotless-conventions")
id("com.hedera.fullstack.spotless-kotlin-conventions")
}

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,15 @@
* limitations under the License.
*/

package com.hedera.fullstack.gradle.plugin;
plugins {
`kotlin-dsl`
}

public class Dummy {}
repositories {
gradlePluginPortal()
mavenCentral()
}

dependencies {
implementation("com.gradle:gradle-enterprise-gradle-plugin:3.14.1")
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
/*
* Copyright (C) 2023 Hedera Hashgraph, LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

pluginManagement {
repositories {
gradlePluginPortal()
mavenCentral()
}
}

plugins {
id("com.gradle.enterprise")
}

// Enable Gradle Build Scan
gradleEnterprise {
buildScan {
termsOfServiceUrl = "https://gradle.com/terms-of-service"
termsOfServiceAgree = "yes"

if (!System.getenv("CI").isNullOrEmpty()) {
publishAlways()
tag("CI")
}
}
}

// Allow projects inside a build to be addressed by dependency coordinates notation.
// https://docs.gradle.org/current/userguide/composite_builds.html#included_build_declaring_substitutions
// Some functionality of the 'java-module-dependencies' plugin relies on this.
includeBuild(".")
23 changes: 17 additions & 6 deletions build-logic/settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,8 +1,19 @@

//dependencyResolutionManagement {
// repositories {
// gradlePluginPortal()
// }
//}
/*
* Copyright (C) 2023 Hedera Hashgraph, LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

includeBuild("project-plugins")

includeBuild("settings-plugins")
2 changes: 1 addition & 1 deletion build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* limitations under the License.
*/

plugins { id("com.hedera.fullstack.umbrella") }
plugins { id("com.hedera.fullstack.root") }

repositories {
// mavenLocal() // uncomment to use local maven repository
Expand Down
23 changes: 23 additions & 0 deletions charts/fullstack-cluster-setup/.helmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Patterns to ignore when building packages.
# This supports shell glob matching, relative path matching, and
# negation (prefixed with !). Only one pattern per line.
.DS_Store
# Common VCS dirs
.git/
.gitignore
.bzr/
.bzrignore
.hg/
.hgignore
.svn/
# Common backup files
*.swp
*.bak
*.tmp
*.orig
*~
# Various IDEs
.project
.idea/
*.tmproj
.vscode/
24 changes: 24 additions & 0 deletions charts/fullstack-cluster-setup/Chart.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
apiVersion: v2
name: fullstack-cluster-setup
description: A Helm chart to setup shared resources for fullstack-testing

# A chart can be either an 'application' or a 'library' chart.
#
# Application charts are a collection of templates that can be packaged into versioned archives
# to be deployed.
#
# Library charts provide useful utilities or functions for the chart developer. They're included as
# a dependency of application charts to inject those utilities and functions into the rendering
# pipeline. Library charts do not define any templates and therefore cannot be deployed.
type: application

# This is the chart version. This version number should be incremented each time you make changes
# to the chart and its templates, including the app version.
# Versions are expected to follow Semantic Versioning (https://semver.org/)
version: 0.8.0

# This is the version number of the application being deployed. This version number should be
# incremented each time you make changes to the application. Versions are not expected to
# follow Semantic Versioning. They should reflect the version the application is using.
# It is recommended to use it with quotes.
appVersion: "0.8.0"
Empty file.
51 changes: 51 additions & 0 deletions charts/fullstack-cluster-setup/templates/_helpers.tpl
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{{/*
Expand the name of the chart.
*/}}
{{- define "fullstack-cluster-setup.name" -}}
{{- default .Chart.Name .Values.global.nameOverride | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Create a default fully qualified app name.
We truncate at 63 chars because some Kubernetes name fields are limited to this (by the DNS naming spec).
If release name contains chart name it will be used as a full name.
*/}}
{{- define "fullstack-cluster-setup.fullname" -}}
{{- if .Values.global.fullnameOverride }}
{{- .Values.global.fullnameOverride | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- $name := default .Chart.Name .Values.global.nameOverride }}
{{- if contains $name .Release.Name }}
{{- .Release.Name | trunc 63 | trimSuffix "-" }}
{{- else }}
{{- printf "%s-%s" .Release.Name $name | trunc 63 | trimSuffix "-" }}
{{- end }}
{{- end }}
{{- end }}

{{/*
Create chart name and version as used by the chart label.
*/}}
{{- define "fullstack-cluster-setup.chart" -}}
{{- printf "%s-%s" .Chart.Name .Chart.Version | replace "+" "_" | trunc 63 | trimSuffix "-" }}
{{- end }}

{{/*
Common labels
*/}}
{{- define "fullstack-cluster-setup.labels" -}}
helm.sh/chart: {{ include "fullstack-cluster-setup.chart" . }}
{{ include "fullstack-cluster-setup.selectorLabels" . }}
{{- if .Chart.AppVersion }}
app.kubernetes.io/version: {{ .Chart.AppVersion | quote }}
{{- end }}
app.kubernetes.io/managed-by: {{ .Release.Service }}
{{- end }}

{{/*
Selector labels
*/}}
{{- define "fullstack-cluster-setup.selectorLabels" -}}
app.kubernetes.io/name: {{ include "fullstack-cluster-setup.name" . }}
app.kubernetes.io/instance: {{ .Release.Name }}
{{- end }}
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
apiVersion: gateway.networking.k8s.io/v1beta1
kind: GatewayClass
metadata:
name: fst-gateway-class
labels:
fullstack.hedera.com/type: gateway-class
spec:
controllerName: "gateway.envoyproxy.io/gatewayclass-controller"
#controllerName: "haproxy-ingress.github.io/controller"
Loading

0 comments on commit 378be41

Please sign in to comment.