Skip to content

Commit 31ae356

Browse files
bigdazgithub-actions[bot]
authored andcommitted
[bot] Update dist directory
1 parent 719985d commit 31ae356

File tree

8 files changed

+52
-204
lines changed

8 files changed

+52
-204
lines changed

dist/dependency-submission/main/index.js

Lines changed: 12 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -145087,12 +145087,9 @@ async function setup(config) {
145087145087
maybeExportVariableNotEmpty('GRADLE_PLUGIN_REPOSITORY_URL', config.getGradlePluginRepositoryUrl());
145088145088
maybeExportVariableNotEmpty('GRADLE_PLUGIN_REPOSITORY_USERNAME', config.getGradlePluginRepositoryUsername());
145089145089
maybeExportVariableNotEmpty('GRADLE_PLUGIN_REPOSITORY_PASSWORD', config.getGradlePluginRepositoryPassword());
145090-
(0, short_lived_token_1.setupToken)(config.getDevelocityAccessKey(), config.getDevelocityTokenExpiry(), getEnv('DEVELOCITY_ENFORCE_URL'), getEnv('DEVELOCITY_URL'));
145090+
(0, short_lived_token_1.setupToken)(config.getDevelocityAccessKey(), config.getDevelocityTokenExpiry());
145091145091
}
145092145092
exports.setup = setup;
145093-
function getEnv(variableName) {
145094-
return process.env[variableName];
145095-
}
145096145093
function maybeExportVariable(variableName, value) {
145097145094
if (!process.env[variableName]) {
145098145095
core.exportVariable(variableName, value);
@@ -145141,23 +145138,23 @@ const httpm = __importStar(__nccwpck_require__(15538));
145141145138
const core = __importStar(__nccwpck_require__(42186));
145142145139
const configuration_1 = __nccwpck_require__(15778);
145143145140
const deprecation_collector_1 = __nccwpck_require__(22572);
145144-
async function setupToken(develocityAccessKey, develocityTokenExpiry, enforceUrl, develocityUrl) {
145141+
async function setupToken(develocityAccessKey, develocityTokenExpiry) {
145145145142
if (develocityAccessKey) {
145146145143
try {
145147145144
core.debug('Fetching short-lived token...');
145148-
const tokens = await getToken(enforceUrl, develocityUrl, develocityAccessKey, develocityTokenExpiry);
145145+
const tokens = await getToken(develocityAccessKey, develocityTokenExpiry);
145149145146
if (tokens != null && !tokens.isEmpty()) {
145150145147
core.debug(`Got token(s), setting the access key env vars`);
145151145148
const token = tokens.raw();
145152145149
core.setSecret(token);
145153145150
exportAccessKeyEnvVars(token);
145154145151
}
145155145152
else {
145156-
handleMissingAccessTokenWithDeprecationWarning();
145153+
handleMissingAccessToken();
145157145154
}
145158145155
}
145159145156
catch (e) {
145160-
handleMissingAccessTokenWithDeprecationWarning();
145157+
handleMissingAccessToken();
145161145158
core.warning(`Failed to fetch short-lived token, reason: ${e}`);
145162145159
}
145163145160
}
@@ -145167,51 +145164,31 @@ function exportAccessKeyEnvVars(value) {
145167145164
;
145168145165
[configuration_1.BuildScanConfig.DevelocityAccessKeyEnvVar, configuration_1.BuildScanConfig.GradleEnterpriseAccessKeyEnvVar].forEach(key => core.exportVariable(key, value));
145169145166
}
145170-
function handleMissingAccessTokenWithDeprecationWarning() {
145167+
function handleMissingAccessToken() {
145168+
core.warning(`Failed to fetch short-lived token for Develocity`);
145171145169
if (process.env[configuration_1.BuildScanConfig.GradleEnterpriseAccessKeyEnvVar]) {
145172145170
(0, deprecation_collector_1.recordDeprecation)(`The ${configuration_1.BuildScanConfig.GradleEnterpriseAccessKeyEnvVar} env var is deprecated`);
145173145171
}
145174145172
if (process.env[configuration_1.BuildScanConfig.DevelocityAccessKeyEnvVar]) {
145175-
core.warning(`Failed to fetch short-lived token, using Develocity Access key`);
145173+
core.warning(`The ${configuration_1.BuildScanConfig.DevelocityAccessKeyEnvVar} env var should be mapped to a short-lived token`);
145176145174
}
145177145175
}
145178-
async function getToken(enforceUrl, serverUrl, accessKey, expiry) {
145176+
async function getToken(accessKey, expiry) {
145179145177
const empty = new Promise(r => r(null));
145180145178
const develocityAccessKey = DevelocityAccessCredentials.parse(accessKey);
145181145179
const shortLivedTokenClient = new ShortLivedTokenClient();
145182-
async function promiseError(message) {
145183-
return new Promise((resolve, reject) => reject(new Error(message)));
145184-
}
145185145180
if (develocityAccessKey == null) {
145186145181
return empty;
145187145182
}
145188-
if (enforceUrl === 'true' || develocityAccessKey.isSingleKey()) {
145189-
if (!serverUrl) {
145190-
return promiseError('Develocity Server URL not configured');
145191-
}
145192-
const hostname = extractHostname(serverUrl);
145193-
if (hostname == null) {
145194-
return promiseError('Could not extract hostname from Develocity server URL');
145195-
}
145196-
const hostAccessKey = develocityAccessKey.forHostname(hostname);
145197-
if (!hostAccessKey) {
145198-
return promiseError(`Could not find corresponding key for hostname ${hostname}`);
145199-
}
145200-
try {
145201-
const token = await shortLivedTokenClient.fetchToken(serverUrl, hostAccessKey, expiry);
145202-
return DevelocityAccessCredentials.of([token]);
145203-
}
145204-
catch (e) {
145205-
return new Promise((resolve, reject) => reject(e));
145206-
}
145207-
}
145208145183
const tokens = new Array();
145209145184
for (const k of develocityAccessKey.keys) {
145210145185
try {
145186+
core.info(`Requesting short-lived Develocity access token for ${k.hostname}`);
145211145187
const token = await shortLivedTokenClient.fetchToken(`https://${k.hostname}`, k, expiry);
145212145188
tokens.push(token);
145213145189
}
145214145190
catch (e) {
145191+
core.info(`Failed to obtain short-lived Develocity access token for ${k.hostname}: ${e}`);
145215145192
}
145216145193
}
145217145194
if (tokens.length > 0) {
@@ -145220,18 +145197,9 @@ async function getToken(enforceUrl, serverUrl, accessKey, expiry) {
145220145197
return empty;
145221145198
}
145222145199
exports.getToken = getToken;
145223-
function extractHostname(serverUrl) {
145224-
try {
145225-
const parsedUrl = new URL(serverUrl);
145226-
return parsedUrl.hostname;
145227-
}
145228-
catch (error) {
145229-
return null;
145230-
}
145231-
}
145232145200
class ShortLivedTokenClient {
145233145201
constructor() {
145234-
this.httpc = new httpm.HttpClient('gradle/setup-gradle');
145202+
this.httpc = new httpm.HttpClient('gradle/actions/setup-gradle');
145235145203
this.maxRetries = 3;
145236145204
this.retryInterval = 1000;
145237145205
}
@@ -145287,12 +145255,6 @@ class DevelocityAccessCredentials {
145287145255
isEmpty() {
145288145256
return this.keys.length === 0;
145289145257
}
145290-
isSingleKey() {
145291-
return this.keys.length === 1;
145292-
}
145293-
forHostname(hostname) {
145294-
return this.keys.find(hostKey => hostKey.hostname === hostname);
145295-
}
145296145258
raw() {
145297145259
return this.keys
145298145260
.map(k => `${k.hostname}${DevelocityAccessCredentials.hostDelimiter}${k.key}`)

dist/dependency-submission/main/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/dependency-submission/post/index.js

Lines changed: 12 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -96244,12 +96244,9 @@ async function setup(config) {
9624496244
maybeExportVariableNotEmpty('GRADLE_PLUGIN_REPOSITORY_URL', config.getGradlePluginRepositoryUrl());
9624596245
maybeExportVariableNotEmpty('GRADLE_PLUGIN_REPOSITORY_USERNAME', config.getGradlePluginRepositoryUsername());
9624696246
maybeExportVariableNotEmpty('GRADLE_PLUGIN_REPOSITORY_PASSWORD', config.getGradlePluginRepositoryPassword());
96247-
(0, short_lived_token_1.setupToken)(config.getDevelocityAccessKey(), config.getDevelocityTokenExpiry(), getEnv('DEVELOCITY_ENFORCE_URL'), getEnv('DEVELOCITY_URL'));
96247+
(0, short_lived_token_1.setupToken)(config.getDevelocityAccessKey(), config.getDevelocityTokenExpiry());
9624896248
}
9624996249
exports.setup = setup;
96250-
function getEnv(variableName) {
96251-
return process.env[variableName];
96252-
}
9625396250
function maybeExportVariable(variableName, value) {
9625496251
if (!process.env[variableName]) {
9625596252
core.exportVariable(variableName, value);
@@ -96298,23 +96295,23 @@ const httpm = __importStar(__nccwpck_require__(5538));
9629896295
const core = __importStar(__nccwpck_require__(2186));
9629996296
const configuration_1 = __nccwpck_require__(5778);
9630096297
const deprecation_collector_1 = __nccwpck_require__(2572);
96301-
async function setupToken(develocityAccessKey, develocityTokenExpiry, enforceUrl, develocityUrl) {
96298+
async function setupToken(develocityAccessKey, develocityTokenExpiry) {
9630296299
if (develocityAccessKey) {
9630396300
try {
9630496301
core.debug('Fetching short-lived token...');
96305-
const tokens = await getToken(enforceUrl, develocityUrl, develocityAccessKey, develocityTokenExpiry);
96302+
const tokens = await getToken(develocityAccessKey, develocityTokenExpiry);
9630696303
if (tokens != null && !tokens.isEmpty()) {
9630796304
core.debug(`Got token(s), setting the access key env vars`);
9630896305
const token = tokens.raw();
9630996306
core.setSecret(token);
9631096307
exportAccessKeyEnvVars(token);
9631196308
}
9631296309
else {
96313-
handleMissingAccessTokenWithDeprecationWarning();
96310+
handleMissingAccessToken();
9631496311
}
9631596312
}
9631696313
catch (e) {
96317-
handleMissingAccessTokenWithDeprecationWarning();
96314+
handleMissingAccessToken();
9631896315
core.warning(`Failed to fetch short-lived token, reason: ${e}`);
9631996316
}
9632096317
}
@@ -96324,51 +96321,31 @@ function exportAccessKeyEnvVars(value) {
9632496321
;
9632596322
[configuration_1.BuildScanConfig.DevelocityAccessKeyEnvVar, configuration_1.BuildScanConfig.GradleEnterpriseAccessKeyEnvVar].forEach(key => core.exportVariable(key, value));
9632696323
}
96327-
function handleMissingAccessTokenWithDeprecationWarning() {
96324+
function handleMissingAccessToken() {
96325+
core.warning(`Failed to fetch short-lived token for Develocity`);
9632896326
if (process.env[configuration_1.BuildScanConfig.GradleEnterpriseAccessKeyEnvVar]) {
9632996327
(0, deprecation_collector_1.recordDeprecation)(`The ${configuration_1.BuildScanConfig.GradleEnterpriseAccessKeyEnvVar} env var is deprecated`);
9633096328
}
9633196329
if (process.env[configuration_1.BuildScanConfig.DevelocityAccessKeyEnvVar]) {
96332-
core.warning(`Failed to fetch short-lived token, using Develocity Access key`);
96330+
core.warning(`The ${configuration_1.BuildScanConfig.DevelocityAccessKeyEnvVar} env var should be mapped to a short-lived token`);
9633396331
}
9633496332
}
96335-
async function getToken(enforceUrl, serverUrl, accessKey, expiry) {
96333+
async function getToken(accessKey, expiry) {
9633696334
const empty = new Promise(r => r(null));
9633796335
const develocityAccessKey = DevelocityAccessCredentials.parse(accessKey);
9633896336
const shortLivedTokenClient = new ShortLivedTokenClient();
96339-
async function promiseError(message) {
96340-
return new Promise((resolve, reject) => reject(new Error(message)));
96341-
}
9634296337
if (develocityAccessKey == null) {
9634396338
return empty;
9634496339
}
96345-
if (enforceUrl === 'true' || develocityAccessKey.isSingleKey()) {
96346-
if (!serverUrl) {
96347-
return promiseError('Develocity Server URL not configured');
96348-
}
96349-
const hostname = extractHostname(serverUrl);
96350-
if (hostname == null) {
96351-
return promiseError('Could not extract hostname from Develocity server URL');
96352-
}
96353-
const hostAccessKey = develocityAccessKey.forHostname(hostname);
96354-
if (!hostAccessKey) {
96355-
return promiseError(`Could not find corresponding key for hostname ${hostname}`);
96356-
}
96357-
try {
96358-
const token = await shortLivedTokenClient.fetchToken(serverUrl, hostAccessKey, expiry);
96359-
return DevelocityAccessCredentials.of([token]);
96360-
}
96361-
catch (e) {
96362-
return new Promise((resolve, reject) => reject(e));
96363-
}
96364-
}
9636596340
const tokens = new Array();
9636696341
for (const k of develocityAccessKey.keys) {
9636796342
try {
96343+
core.info(`Requesting short-lived Develocity access token for ${k.hostname}`);
9636896344
const token = await shortLivedTokenClient.fetchToken(`https://${k.hostname}`, k, expiry);
9636996345
tokens.push(token);
9637096346
}
9637196347
catch (e) {
96348+
core.info(`Failed to obtain short-lived Develocity access token for ${k.hostname}: ${e}`);
9637296349
}
9637396350
}
9637496351
if (tokens.length > 0) {
@@ -96377,18 +96354,9 @@ async function getToken(enforceUrl, serverUrl, accessKey, expiry) {
9637796354
return empty;
9637896355
}
9637996356
exports.getToken = getToken;
96380-
function extractHostname(serverUrl) {
96381-
try {
96382-
const parsedUrl = new URL(serverUrl);
96383-
return parsedUrl.hostname;
96384-
}
96385-
catch (error) {
96386-
return null;
96387-
}
96388-
}
9638996357
class ShortLivedTokenClient {
9639096358
constructor() {
96391-
this.httpc = new httpm.HttpClient('gradle/setup-gradle');
96359+
this.httpc = new httpm.HttpClient('gradle/actions/setup-gradle');
9639296360
this.maxRetries = 3;
9639396361
this.retryInterval = 1000;
9639496362
}
@@ -96444,12 +96412,6 @@ class DevelocityAccessCredentials {
9644496412
isEmpty() {
9644596413
return this.keys.length === 0;
9644696414
}
96447-
isSingleKey() {
96448-
return this.keys.length === 1;
96449-
}
96450-
forHostname(hostname) {
96451-
return this.keys.find(hostKey => hostKey.hostname === hostname);
96452-
}
9645396415
raw() {
9645496416
return this.keys
9645596417
.map(k => `${k.hostname}${DevelocityAccessCredentials.hostDelimiter}${k.key}`)

dist/dependency-submission/post/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/setup-gradle/main/index.js

Lines changed: 12 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -145015,12 +145015,9 @@ async function setup(config) {
145015145015
maybeExportVariableNotEmpty('GRADLE_PLUGIN_REPOSITORY_URL', config.getGradlePluginRepositoryUrl());
145016145016
maybeExportVariableNotEmpty('GRADLE_PLUGIN_REPOSITORY_USERNAME', config.getGradlePluginRepositoryUsername());
145017145017
maybeExportVariableNotEmpty('GRADLE_PLUGIN_REPOSITORY_PASSWORD', config.getGradlePluginRepositoryPassword());
145018-
(0, short_lived_token_1.setupToken)(config.getDevelocityAccessKey(), config.getDevelocityTokenExpiry(), getEnv('DEVELOCITY_ENFORCE_URL'), getEnv('DEVELOCITY_URL'));
145018+
(0, short_lived_token_1.setupToken)(config.getDevelocityAccessKey(), config.getDevelocityTokenExpiry());
145019145019
}
145020145020
exports.setup = setup;
145021-
function getEnv(variableName) {
145022-
return process.env[variableName];
145023-
}
145024145021
function maybeExportVariable(variableName, value) {
145025145022
if (!process.env[variableName]) {
145026145023
core.exportVariable(variableName, value);
@@ -145069,23 +145066,23 @@ const httpm = __importStar(__nccwpck_require__(15538));
145069145066
const core = __importStar(__nccwpck_require__(42186));
145070145067
const configuration_1 = __nccwpck_require__(15778);
145071145068
const deprecation_collector_1 = __nccwpck_require__(22572);
145072-
async function setupToken(develocityAccessKey, develocityTokenExpiry, enforceUrl, develocityUrl) {
145069+
async function setupToken(develocityAccessKey, develocityTokenExpiry) {
145073145070
if (develocityAccessKey) {
145074145071
try {
145075145072
core.debug('Fetching short-lived token...');
145076-
const tokens = await getToken(enforceUrl, develocityUrl, develocityAccessKey, develocityTokenExpiry);
145073+
const tokens = await getToken(develocityAccessKey, develocityTokenExpiry);
145077145074
if (tokens != null && !tokens.isEmpty()) {
145078145075
core.debug(`Got token(s), setting the access key env vars`);
145079145076
const token = tokens.raw();
145080145077
core.setSecret(token);
145081145078
exportAccessKeyEnvVars(token);
145082145079
}
145083145080
else {
145084-
handleMissingAccessTokenWithDeprecationWarning();
145081+
handleMissingAccessToken();
145085145082
}
145086145083
}
145087145084
catch (e) {
145088-
handleMissingAccessTokenWithDeprecationWarning();
145085+
handleMissingAccessToken();
145089145086
core.warning(`Failed to fetch short-lived token, reason: ${e}`);
145090145087
}
145091145088
}
@@ -145095,51 +145092,31 @@ function exportAccessKeyEnvVars(value) {
145095145092
;
145096145093
[configuration_1.BuildScanConfig.DevelocityAccessKeyEnvVar, configuration_1.BuildScanConfig.GradleEnterpriseAccessKeyEnvVar].forEach(key => core.exportVariable(key, value));
145097145094
}
145098-
function handleMissingAccessTokenWithDeprecationWarning() {
145095+
function handleMissingAccessToken() {
145096+
core.warning(`Failed to fetch short-lived token for Develocity`);
145099145097
if (process.env[configuration_1.BuildScanConfig.GradleEnterpriseAccessKeyEnvVar]) {
145100145098
(0, deprecation_collector_1.recordDeprecation)(`The ${configuration_1.BuildScanConfig.GradleEnterpriseAccessKeyEnvVar} env var is deprecated`);
145101145099
}
145102145100
if (process.env[configuration_1.BuildScanConfig.DevelocityAccessKeyEnvVar]) {
145103-
core.warning(`Failed to fetch short-lived token, using Develocity Access key`);
145101+
core.warning(`The ${configuration_1.BuildScanConfig.DevelocityAccessKeyEnvVar} env var should be mapped to a short-lived token`);
145104145102
}
145105145103
}
145106-
async function getToken(enforceUrl, serverUrl, accessKey, expiry) {
145104+
async function getToken(accessKey, expiry) {
145107145105
const empty = new Promise(r => r(null));
145108145106
const develocityAccessKey = DevelocityAccessCredentials.parse(accessKey);
145109145107
const shortLivedTokenClient = new ShortLivedTokenClient();
145110-
async function promiseError(message) {
145111-
return new Promise((resolve, reject) => reject(new Error(message)));
145112-
}
145113145108
if (develocityAccessKey == null) {
145114145109
return empty;
145115145110
}
145116-
if (enforceUrl === 'true' || develocityAccessKey.isSingleKey()) {
145117-
if (!serverUrl) {
145118-
return promiseError('Develocity Server URL not configured');
145119-
}
145120-
const hostname = extractHostname(serverUrl);
145121-
if (hostname == null) {
145122-
return promiseError('Could not extract hostname from Develocity server URL');
145123-
}
145124-
const hostAccessKey = develocityAccessKey.forHostname(hostname);
145125-
if (!hostAccessKey) {
145126-
return promiseError(`Could not find corresponding key for hostname ${hostname}`);
145127-
}
145128-
try {
145129-
const token = await shortLivedTokenClient.fetchToken(serverUrl, hostAccessKey, expiry);
145130-
return DevelocityAccessCredentials.of([token]);
145131-
}
145132-
catch (e) {
145133-
return new Promise((resolve, reject) => reject(e));
145134-
}
145135-
}
145136145111
const tokens = new Array();
145137145112
for (const k of develocityAccessKey.keys) {
145138145113
try {
145114+
core.info(`Requesting short-lived Develocity access token for ${k.hostname}`);
145139145115
const token = await shortLivedTokenClient.fetchToken(`https://${k.hostname}`, k, expiry);
145140145116
tokens.push(token);
145141145117
}
145142145118
catch (e) {
145119+
core.info(`Failed to obtain short-lived Develocity access token for ${k.hostname}: ${e}`);
145143145120
}
145144145121
}
145145145122
if (tokens.length > 0) {
@@ -145148,18 +145125,9 @@ async function getToken(enforceUrl, serverUrl, accessKey, expiry) {
145148145125
return empty;
145149145126
}
145150145127
exports.getToken = getToken;
145151-
function extractHostname(serverUrl) {
145152-
try {
145153-
const parsedUrl = new URL(serverUrl);
145154-
return parsedUrl.hostname;
145155-
}
145156-
catch (error) {
145157-
return null;
145158-
}
145159-
}
145160145128
class ShortLivedTokenClient {
145161145129
constructor() {
145162-
this.httpc = new httpm.HttpClient('gradle/setup-gradle');
145130+
this.httpc = new httpm.HttpClient('gradle/actions/setup-gradle');
145163145131
this.maxRetries = 3;
145164145132
this.retryInterval = 1000;
145165145133
}
@@ -145215,12 +145183,6 @@ class DevelocityAccessCredentials {
145215145183
isEmpty() {
145216145184
return this.keys.length === 0;
145217145185
}
145218-
isSingleKey() {
145219-
return this.keys.length === 1;
145220-
}
145221-
forHostname(hostname) {
145222-
return this.keys.find(hostKey => hostKey.hostname === hostname);
145223-
}
145224145186
raw() {
145225145187
return this.keys
145226145188
.map(k => `${k.hostname}${DevelocityAccessCredentials.hostDelimiter}${k.key}`)

dist/setup-gradle/main/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)