This is an automated email from the ASF dual-hosted git repository.
riemer pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/streampipes.git
The following commit(s) were added to refs/heads/dev by this push:
new d60417f3dc feat: Enhance Develocity Build Scans (#3869)
d60417f3dc is described below
commit d60417f3dc2c447ac16c69891cfaa5ff3b3e8858
Author: Clay Johnson <[email protected]>
AuthorDate: Mon Oct 27 14:23:48 2025 -0500
feat: Enhance Develocity Build Scans (#3869)
---
.mvn/develocity.xml | 2 +-
ui/develocity.config.js | 95 ++++++++++++++++++++++++++++++++++++++++++++++++-
2 files changed, 95 insertions(+), 2 deletions(-)
diff --git a/.mvn/develocity.xml b/.mvn/develocity.xml
index 3ff010609c..82160d3394 100644
--- a/.mvn/develocity.xml
+++ b/.mvn/develocity.xml
@@ -41,7 +41,7 @@
</local>
<remote>
<enabled>true</enabled>
- <storeEnabled>#{isTrue(env['CI']) and
isTrue(env['STREAMPIPES_DEVELOCITY_ACCESS_KEY'])}</storeEnabled>
+ <storeEnabled>#{isTrue(env['CI']) and
isTrue(env['DEVELOCITY_ACCESS_KEY'])}</storeEnabled>
</remote>
</buildCache>
</develocity>
diff --git a/ui/develocity.config.js b/ui/develocity.config.js
index 3e49629eb6..49a1c70b8d 100644
--- a/ui/develocity.config.js
+++ b/ui/develocity.config.js
@@ -18,8 +18,101 @@
under the License.
*/
+const {
+ fromPropertiesFile,
+ inGradleUserHome,
+} = require('@gradle-tech/develocity-agent/api/config');
+const { execSync } = require('node:child_process');
+
+const develocityUrl =
+ process.env.DEVELOCITY_URL !== undefined
+ ? process.env.DEVELOCITY_URL
+ : 'https://develocity.apache.org';
+
module.exports = {
server: {
- url: 'https://develocity.apache.org',
+ url: develocityUrl,
},
+ buildScan: buildScanUserData(),
};
+
+function buildScanUserData() {
+ const links = {};
+ const tags = [];
+ const values = {};
+
+ // Add environment information
+ const isCI = process.env.CI !== undefined;
+ tags.push(isCI ? 'CI' : 'Local');
+
+ // Add Git information if available
+ const gitRepo = outputOf('git config --get remote.origin.url');
+ const gitCommitId = outputOf('git rev-parse --verify HEAD');
+ const gitCommitShortId = outputOf('git rev-parse --short=8 --verify HEAD');
+ const gitBranch = outputOf('git branch --show-current');
+ const gitStatus = outputOf('git status --porcelain');
+ if (gitRepo !== undefined) {
+ values['Git repository'] = gitRepo;
+ }
+ if (gitCommitId !== undefined) {
+ values['Git commit id'] = gitCommitId;
+ // use your Develocity URL to add proper links
+ links['Git Commit Build Scans'] =
+
`${develocityUrl}/scans?search.names=Git+commit+id&search.values=${gitCommitId}`;
+ }
+ if (gitCommitShortId !== undefined) {
+ values['Git commit id short'] = gitCommitShortId;
+ }
+ if (gitBranch !== undefined) {
+ tags.push(gitBranch);
+ values['Git branch'] = gitBranch;
+ }
+ if (gitStatus) {
+ tags.push('Dirty');
+ values['Git status'] = gitStatus;
+ }
+
+ // Add CI information if available
+ if (process.env.GITHUB_ACTIONS) {
+ values['CI provider'] = 'GitHub Actions';
+ if (process.env.GITHUB_WORKFLOW !== undefined) {
+ values['CI workflow'] = process.env.GITHUB_WORKFLOW;
+ }
+ if (process.env.GITHUB_JOB !== undefined) {
+ values['CI job'] = process.env.GITHUB_JOB;
+ }
+ if (process.env.GITHUB_ACTION !== undefined) {
+ values['CI step'] = process.env.GITHUB_ACTION;
+ }
+ if (process.env.GITHUB_RUN_ID !== undefined) {
+ values['CI run'] = process.env.GITHUB_RUN_ID;
+ }
+ if (process.env.GITHUB_RUN_ATTEMPT !== undefined) {
+ values['CI run attempt'] = process.env.GITHUB_RUN_ATTEMPT;
+ }
+ if (process.env.GITHUB_RUN_NUMBER !== undefined) {
+ values['CI run number'] = process.env.GITHUB_RUN_NUMBER;
+ }
+ if (
+ process.env.GITHUB_HEAD_REF !== undefined &&
+ process.env.GITHUB_HEAD_REF !== ''
+ ) {
+ values['PR branch'] = process.env.GITHUB_HEAD_REF;
+ }
+ }
+
+ return {
+ links,
+ tags,
+ values,
+ };
+}
+
+function outputOf(command) {
+ try {
+ return execSync(command, { encoding: 'utf-8' }).toString().trim();
+ } catch {
+ // ignore errors, most likely the command is not available
+ return undefined;
+ }
+}