@forgehive/forge-cli 0.3.11 → 0.3.12

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -49,7 +49,7 @@ const boundaries = {
49
49
 
50
50
  return buildsPath
51
51
  },
52
- sendLogToAPI: async (profile: Profile, projectName: string, record: ExecutionRecord): Promise<boolean> => {
52
+ sendLogToAPI: async (profile: Profile, projectName: string, record: ExecutionRecord, taskUuid?: string): Promise<{ success: boolean; logUuid?: string; taskUuid?: string }> => {
53
53
  try {
54
54
  const config = {
55
55
  projectName,
@@ -64,19 +64,25 @@ const boundaries = {
64
64
  const client = new HiveLogClient(config)
65
65
  const result = await client.sendLog(record)
66
66
 
67
- if (result === 'success') {
67
+ if (result === 'success' || (typeof result === 'object' && 'uuid' in result)) {
68
68
  console.log('===============================================')
69
69
  console.log('Log sent to API... ', profile.name, profile.url)
70
- return true
70
+
71
+ if (typeof result === 'object' && result && 'uuid' in result) {
72
+ const logResponse = result as { uuid: string }
73
+ return { success: true, logUuid: logResponse.uuid, taskUuid }
74
+ }
75
+
76
+ return { success: true, taskUuid }
71
77
  } else {
72
78
  console.error('Failed to send log to API:', profile.url)
73
- return false
79
+ return { success: false }
74
80
  }
75
81
  } catch (e) {
76
82
  console.error('Failed to send log to API:', profile.url)
77
83
  const error = e as Error
78
84
  console.error('Error:', error.message)
79
- return false
85
+ return { success: false }
80
86
  }
81
87
  }
82
88
  }
@@ -97,6 +103,7 @@ export const run = createTask({
97
103
  const forge: ForgeConf = await loadConf({})
98
104
  const taskDescriptor = forge.tasks[descriptorName as keyof typeof forge.tasks]
99
105
  const projectName = forge.project.name
106
+ const taskUuid = taskDescriptor?.uuid
100
107
 
101
108
  if (taskDescriptor === undefined) {
102
109
  throw new Error('Task is not defined on forge.json')
@@ -169,7 +176,11 @@ export const run = createTask({
169
176
 
170
177
  if (profile) {
171
178
  try {
172
- await sendLogToAPI(profile, projectName, logItem)
179
+ const logResult = await sendLogToAPI(profile, projectName, logItem, taskUuid)
180
+
181
+ if (logResult.success && taskUuid) {
182
+ console.log(`🔗 View execution logs: ${profile.url}/tasks/${taskUuid}?tab=logs`)
183
+ }
173
184
  } catch (e) {
174
185
  console.error('Failed to send log to API:', e)
175
186
  }
@@ -48,6 +48,9 @@ export interface Profile {
48
48
  apiKey: string
49
49
  apiSecret: string
50
50
  url: string
51
+ teamName?: string
52
+ teamUuid?: string
53
+ userName?: string
51
54
  }
52
55
 
53
56
  export interface Profiles {