Skip to content

Commit

Permalink
Merge pull request #14 from getappmap/feat/live-urls
Browse files Browse the repository at this point in the history
feat: Live urls
  • Loading branch information
kgilpin authored May 24, 2023
2 parents 6ee786d + a6006bf commit b257831
Show file tree
Hide file tree
Showing 15 changed files with 183 additions and 81 deletions.
3 changes: 1 addition & 2 deletions .github/workflows/appmap-archive.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,8 @@ jobs:

- name: Install AppMap tools
run: |
curl -o /usr/local/bin/appmap -L https://github.com/getappmap/appmap-js/releases/download/%40appland%2Fappmap-preflight-v1.0-pre.19/appmap-preflight-linux-x64
curl -o /usr/local/bin/appmap -L https://github.com/getappmap/appmap-js/releases/download/%40appland%2Fappmap-preflight-v1.0-pre.21/appmap-preflight-linux-x64
chmod a+x /usr/local/bin/appmap
ln -s /usr/local/bin/appmap /tmp/appmap
- name: Build AppMaps
run: yarn test
Expand Down
3 changes: 1 addition & 2 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,8 @@ jobs:

- name: Install AppMap tools
run: |
curl -o /usr/local/bin/appmap -L https://github.com/getappmap/appmap-js/releases/download/%40appland%2Fappmap-preflight-v1.0-pre.19/appmap-preflight-linux-x64
curl -o /usr/local/bin/appmap -L https://github.com/getappmap/appmap-js/releases/download/%40appland%2Fappmap-preflight-v1.0-pre.21/appmap-preflight-linux-x64
chmod a+x /usr/local/bin/appmap
ln -s /usr/local/bin/appmap /tmp/appmap
- name: Build
run: yarn build
Expand Down
2 changes: 1 addition & 1 deletion dist/check/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

108 changes: 75 additions & 33 deletions dist/preflight/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/preflight/index.js.map

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/Archiver.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import log, {LogLevel} from './log';
import verbose from './verbose';

export default class Archiver {
public appmapCommand = '/tmp/appmap';
public appmapCommand = 'appmap';
public archiveBranch = 'appmap-archive';

constructor(public artifactStore: ArtifactStore, public revision: string) {}
Expand Down
2 changes: 1 addition & 1 deletion src/Compare.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import log, {LogLevel} from './log';
import verbose from './verbose';

export default class Compare {
public appmapCommand = '/tmp/appmap';
public appmapCommand = 'appmap';
public sourceDir?: string;
public outputDir?: string;

Expand Down
6 changes: 3 additions & 3 deletions src/CommandOptions.ts → src/CompareOptions.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export interface CommandOptions {
baseRef: string;
headRef: string;
export default interface CompareOptions {
baseRevision: string;
headRevision: string;
appmapCommand?: string;
sourceDir?: string;
githubToken?: string;
Expand Down
12 changes: 9 additions & 3 deletions src/MarkdownReport.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
import ReportOptions from './ReportOptions';
import {executeCommand} from './executeCommand';
import verbose from './verbose';

export default class MarkdownReport {
public appmapCommand = '/tmp/appmap';
public appmapCommand = 'appmap';

constructor(public reportDir: string) {}
constructor(public reportDir: string, public options: ReportOptions) {
if (options.appmapCommand) this.appmapCommand = options.appmapCommand;
}

async generateReport() {
let cmd = `${this.appmapCommand} compare-report ${this.reportDir}`;
let cmd = `${this.appmapCommand} compare-report`;
if (verbose()) cmd += ' --verbose';
if (this.options.sourceURL) cmd += ` --source-url '${this.options.sourceURL}'`;
if (this.options.appmapURL) cmd += ` --appmap-url '${this.options.appmapURL}'`;
cmd += ` ${this.reportDir}`;
await executeCommand(cmd);
}
}
5 changes: 5 additions & 0 deletions src/ReportOptions.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
export default interface ReportOptions {
sourceURL?: URL;
appmapURL?: URL;
appmapCommand?: string;
}
2 changes: 1 addition & 1 deletion src/Restore.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import verbose from './verbose';
export default class Restore {
public repository?: string;
public githubToken?: string;
public appmapCommand = '/tmp/appmap';
public appmapCommand = 'appmap';

constructor(public revision: string, public outputDir: string) {}

Expand Down
2 changes: 1 addition & 1 deletion src/check.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ async function runInGitHub(): Promise<void> {
}

if (process.env.GITHUB_STEP_SUMMARY) {
await writeFile(summary.join('\n'), process.env.GITHUB_STEP_SUMMARY);
await writeFile(process.env.GITHUB_STEP_SUMMARY, summary.join('\n'));
}
process.exit(1);
}
Expand Down
Loading

0 comments on commit b257831

Please sign in to comment.