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
2 changes: 1 addition & 1 deletion .github/workflows/cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ jobs:

- uses: graalvm/setup-graalvm@v1
with:
java-version: '23'
java-version: '25'
distribution: 'graalvm'
github-token: ${{ secrets.GITHUB_TOKEN }}
# cache: 'maven'
Expand Down
3 changes: 2 additions & 1 deletion README.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
:linkattrs:
:project-owner: oracle-actions
:project-name: setup-testpilot
:project-tag: v1.0.23
:project-tag: v1.0.24

ifdef::env-github[]
:tip-caption: :bulb:
Expand Down Expand Up @@ -37,6 +37,7 @@ Following inputs may be used as `step.with` keys:
| oci-service | | autonomous-transaction-processing-serverless-26ai | A valid Oracle Cloud Infrastructure service to be tested.
Valid OCI service are: `autonomous-transaction-processing-serverless-19c`, `autonomous-transaction-processing-serverless-26ai`, `base-database-service-19c`, `base-database-service-21c`, `base-database-service-23ai`, and `base-database-service-26ai`.
| user | | | The database username to be used for database creation. If multiple users (up to 10) are required then enter a comma-separated list of usernames (no space). Limit usernames to 118 chars maximum. Accepted chars are: upper case letters, lower case letters, digits, colon, hyphen, underscore, and dot.
| connection-string-format | | easy-connect | The resulting connection string format: `easy-connect` or `tns`.
| prefix_list | | | A comma separated list of file(s) or folder(s) that if changed should not trigger any test (example: folder containing documentation).
|===

Expand Down
8 changes: 6 additions & 2 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ branding:
inputs:
version:
description: 'The version to use.'
default: 'v1.0.23'
default: 'v1.0.24'
required: true
action:
description: 'The action to run (create*, delete, skip-testing).'
Expand All @@ -22,6 +22,10 @@ inputs:
user:
description: 'The database username to be used for database creation. If multiple users (up to 10) are required then enter a comma-separated list of usernames (no space). Limit usernames to 118 chars maximum. Accepted chars are: upper case letters, lower case letters, digits, colon, hyphen, underscore, and dot.'
required: false
connection-string-format:
description: 'The resulting connection string format (easy-connect*, tns).'
default: 'easy-connect'
required: false
prefix_list:
description: 'A comma separated list of file(s) or folder(s) that if changed should not trigger any test (example: folder containing documentation).'
required: false
Expand Down Expand Up @@ -74,5 +78,5 @@ runs:
RUNID: ${{ github.run_number }}
run: |
${GITHUB_ACTION_PATH}/setup-testpilot --${{ inputs.action }} \
--user "${{ inputs.user }}" --oci-service "${{ inputs.oci-service }}"
--user "${{ inputs.user }}" --oci-service "${{ inputs.oci-service }}" --connection-string-format "${{ inputs.connection-string-format }}"

12 changes: 6 additions & 6 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,17 +6,17 @@

<groupId>com.oracle.testpilot</groupId>
<artifactId>testpilot-services</artifactId>
<version>1.0.23</version>
<version>1.0.24</version>
<name>Oracle Test Pilot actions</name>
<description>Actions offered by Oracle Test Pilot.</description>
<description>Actions provided by Oracle Test Pilot.</description>

<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<junit.version>5.8.1</junit.version>
<maven.compiler.plugin.version>3.8.1</maven.compiler.plugin.version>
<maven.compiler.source>23</maven.compiler.source>
<maven.compiler.target>23</maven.compiler.target>
<maven.compiler.release>23</maven.compiler.release>
<maven.compiler.source>25</maven.compiler.source>
<maven.compiler.target>25</maven.compiler.target>
<maven.compiler.release>25</maven.compiler.release>
<maven.plugin.validation>VERBOSE</maven.plugin.validation>
<native.maven.plugin.version>0.10.3</native.maven.plugin.version>
<imageName>setup-testpilot</imageName>
Expand Down Expand Up @@ -81,7 +81,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.13.0</version>
<version>3.15.0</version>
<configuration>
<source>${maven.compiler.source}</source>
<target>${maven.compiler.source}</target>
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/oracle/testpilot/Main.java
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ public class Main {
System.setProperty("java.net.useSystemProxies", "false");
}

public static final String VERSION="1.0.23";
public static final String VERSION="1.0.24";

public static void main(final String[] args) {
int exitStatus = 0;
Expand Down Expand Up @@ -53,7 +53,7 @@ public static void main(final String[] args) {
}

//System.out.println("Error: " + te.getMessage());
te.printStackTrace();
te.printStackTrace(System.err);
}

System.exit(exitStatus);
Expand Down
46 changes: 32 additions & 14 deletions src/main/java/com/oracle/testpilot/Session.java
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,7 @@
import com.oracle.testpilot.exception.TestPilotException;
import com.oracle.testpilot.json.JSON;
import com.oracle.testpilot.json.JSONArray;
import com.oracle.testpilot.model.Action;
import com.oracle.testpilot.model.Database;
import com.oracle.testpilot.model.GitHubCommittedFiles;
import com.oracle.testpilot.model.GitHubFilename;
import com.oracle.testpilot.model.GitHubPullRequestCommits;
import com.oracle.testpilot.model.OAuthToken;
import com.oracle.testpilot.model.TechnologyType;
import com.oracle.testpilot.model.*;

import java.io.BufferedOutputStream;
import java.io.FileNotFoundException;
Expand Down Expand Up @@ -61,6 +55,8 @@ public class Session {
private String users;
private String technologyType;

private ConnectionStringFormat connectionStringFormat;

private String prefixList;
private String owner;
private String repository;
Expand Down Expand Up @@ -165,6 +161,21 @@ private void analyzeCommandLineParameters(final String[] args) {
}
break;

case "--connection-string-format":
if (i + 1 < args.length) {
final String temp = args[++i];

if("tns".equalsIgnoreCase(temp)) {
connectionStringFormat = ConnectionStringFormat.TNS;
} else {
connectionStringFormat = ConnectionStringFormat.EASY_CONNECT;
}
}
else {
throw new TestPilotException(CONNECTION_STRING_FORMAT_MISSING_PARAMETER, new IllegalArgumentException("Missing value for --connection-string-format parameter"));
}
break;

case "--skip-testing":
action = SKIP_TESTING;
break;
Expand Down Expand Up @@ -216,15 +227,16 @@ private void analyzeCommandLineParameters(final String[] args) {
private void displayUsage() {
System.out.println("""
Usage: setup-testpilot <action> <options...>

Action:
--create: to provision the requested Oracle Cloud Infrastructure service to test
Options:
--oci-service <value> OCI service type (autonomous-transaction-processing-serverless, base-database-service-19c, base-database-service-21c, base-database-service-23ai)
--oci-service <value> OCI service type (autonomous-transaction-processing-serverless, base-database-service-19c, base-database-service-21c, base-database-service-26ai)
--user <user> user name to be used (if several, then comma separated list without any space)
--connection-string-format requested connection string format (easy-connect*, or tns)
--delete: to de-provision the Oracle Cloud Infrastructure service
Options:
--oci-service <value> OCI service type (autonomous-transaction-processing-serverless, base-database-service-19c, base-database-service-21c, base-database-service-23ai)
--oci-service <value> OCI service type (autonomous-transaction-processing-serverless, base-database-service-19c, base-database-service-21c, base-database-service-26ai)
--user <user> user name to be used (if several, then comma separated list without any space)
--skip-testing
Options:
Expand Down Expand Up @@ -310,7 +322,10 @@ runID, type, buildUserList(users,true))
Database database = new JSON<>(Database.class).parse(jsonInformation);
database = new JSON<>(Database.class).parse(database.getDatabase());

final String connectionString = String.format("(description=(retry_count=5)(retry_delay=1)(address=(protocol=tcps)(port=1521)(host=%s.oraclecloud.com))(connect_data=(USE_TCP_FAST_OPEN=ON)(service_name=%s_tp.adb.oraclecloud.com))(security=(ssl_server_dn_match=no)))", database.getHost(), database.getService());
final String connectionString = connectionStringFormat == ConnectionStringFormat.TNS ?
String.format("(description=(retry_count=5)(retry_delay=1)(address=(protocol=tcps)(port=1521)(host=%s.oraclecloud.com))(connect_data=(USE_TCP_FAST_OPEN=ON)(service_name=%s_tp.adb.oraclecloud.com))(security=(ssl_server_dn_match=no)))", database.getHost(), database.getService())
:
String.format("tcps://%s.oraclecloud.com:1521/%s_tp.adb.oraclecloud.com?retry_count=5&retry_delay=1&oracle.net.useTcpFastOpen=true&ssl_server_dn_match=false", database.getHost(), database.getService());

writeDatabaseInformationToGitHubOutput(database, connectionString);
}
Expand All @@ -322,7 +337,10 @@ runID, type, buildUserList(users,true))
Database database = new JSON<>(Database.class).parse(jsonInformation);
database = new JSON<>(Database.class).parse(database.getDatabase());

final String connectionString = String.format("%s:1521/%s", database.getHost(), database.getService());
final String connectionString = connectionStringFormat == ConnectionStringFormat.TNS ?
String.format("(description=(address=(protocol=tcp)(port=1521)(host=%s))(connect_data=(service_name=%s)))", database.getHost(), database.getService())
:
String.format("%s:1521/%s", database.getHost(), database.getService());

writeDatabaseInformationToGitHubOutput(database, connectionString);
}
Expand Down Expand Up @@ -520,15 +538,15 @@ private String buildUserList(final String users, boolean create) {
return sb.toString();
}

private String getInternalTechnologyType(String technologyType) {
private String getInternalTechnologyType(final String technologyType) {
return switch (technologyType) {
case "autonomous-transaction-processing-serverless-19c" -> TechnologyType.AUTONOMOUS19C;
case "autonomous-transaction-processing-serverless", "autonomous-transaction-processing-serverless-26ai" -> TechnologyType.AUTONOMOUS26AI;
case "base-database-service-19c" -> TechnologyType.DB19C;
case "base-database-service-21c" -> TechnologyType.DB21C;
case "base-database-service-23ai" -> TechnologyType.DB23AI;
case "base-database-service-26ai" -> TechnologyType.DB26AI;
default -> null;
default -> throw new TestPilotException(CREATE_DATABASE_MISSING_DB_TYPE);
};
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ public class TestPilotException extends RuntimeException {
public static final int RETRIEVE_OAUTH2_TOKEN = 8;
public static final int TOO_MANY_USERS_PROVIDED = 9;
public static final int CREATE_DATABASE_MISSING_USER_NAME = 10;
public static final int CREATE_DATABASE_MISSING_PASSWORD = 11;
public static final int CONNECTION_STRING_FORMAT_MISSING_PARAMETER = 11;
public static final int CREATE_DATABASE_MISSING_DB_TYPE = 12;
public static final int SKIP_TESTING_MISSING_OWNER = 13;
public static final int SKIP_TESTING_MISSING_REPOSITORY = 14;
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
/*
** Oracle Test Pilot
**
** Copyright (c) 2025-2026 Oracle
** Licensed under the Universal Permissive License v 1.0 as shown at https://oss.oracle.com/licenses/upl/
*/
package com.oracle.testpilot.model;

/**
* @author LLEFEVRE
* @since 1.0.24
*/
public enum ConnectionStringFormat {
EASY_CONNECT,
TNS
}
Loading