Skip to content

Commit

Permalink
status: make revision commit explicit
Browse files Browse the repository at this point in the history
  • Loading branch information
pulsejet committed May 11, 2024
1 parent ed89702 commit f632918
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
3 changes: 2 additions & 1 deletion framework/ndn-testbed-status/src/App.vue
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,8 @@ export default defineComponent({
},
getRevUrl(router: IRouter) {
return `${TESTBED_REPO}/commit/${router.status!.revision}`;
const ref = router.status?.revision_commit ?? router.status?.revision;
return `${TESTBED_REPO}/commit/${ref}`;
},
getFromNow<T extends number>(timestamp: T) {
Expand Down
1 change: 1 addition & 0 deletions framework/ndn-testbed-status/src/testbed.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ interface IRouter {
interface IStatus {
timestamp: number;
revision: string;
revision_commit: string;
host_info?: {
kernel: string;
os: string;
Expand Down
6 changes: 6 additions & 0 deletions framework/status-json.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@ def get_revision():
cmd = ['git', 'describe', '--dirty', '--always']
return subprocess.check_output(cmd, timeout=5).decode('utf-8').strip()

def get_revision_commit():
print('Getting git revision commit', file=sys.stderr)
cmd = ['git', 'rev-parse', 'HEAD']
return subprocess.check_output(cmd, timeout=5).decode('utf-8').strip()

def get_host_info():
print('Getting host info', file=sys.stderr)
info = compose.info()
Expand Down Expand Up @@ -138,6 +143,7 @@ def get_ws_tls_status(host: dict) -> bool:
status = {
'timestamp': run_safe(get_timestamp),
'revision': run_safe(get_revision),
'revision_commit': run_safe(get_revision_commit),
'host_info': run_safe(get_host_info),
'tls': run_safe(get_tls_status, host),
'ws-tls': run_safe(get_ws_tls_status, host),
Expand Down

0 comments on commit f632918

Please sign in to comment.