Skip to content

Commit

Permalink
ci: Validate types
Browse files Browse the repository at this point in the history
Signed-off-by: Tyler Smalley <tyler@tailscale.com>
  • Loading branch information
tylersmalley committed Jun 6, 2023
1 parent bac7ee7 commit a4e2d30
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 8 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,5 +34,7 @@ jobs:
# if: runner.os != 'Linux'
- name: Lint
run: tool/yarn lint
- name: Typescript
run: tool/yarn tsc --noEmit
- name: Prettier
run: tool/yarn prettier --check .
21 changes: 13 additions & 8 deletions src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -51,14 +51,19 @@ export async function activate(context: vscode.ExtensionContext) {
// assume if we have any BackendState we are installed
vscode.commands.executeCommand('setContext', 'tailscale.walkthroughs.installed', !!commandPath);

if (status?.FunnelOff === false) {
vscode.commands.executeCommand('setContext', 'tailscale.walkthroughs.funnelOn', true);
}

// we only get an NeedsHTTPs value if Funnel is enabled
if (status?.FunnelOff === false && status?.NeedsHTTPs === false) {
vscode.commands.executeCommand('setContext', 'tailscale.walkthroughs.httpsOn', true);
}
// Funnel check
const isFunnelOn = !status?.Errors?.some((e) => e.Type === 'FUNNEL_OFF');
Logger.info(`Funnel is ${isFunnelOn ? 'on' : 'off'}`, 'serve-status');
vscode.commands.executeCommand('setContext', 'tailscale.walkthroughs.funnelOn', isFunnelOn);

// HTTPS check
const isHTTPSOn = !status?.Errors?.some((e) => e.Type === 'HTTPS_OFF');
Logger.info(`HTTPS is ${isFunnelOn && isHTTPSOn ? 'on' : 'off'}`, 'serve-status');
vscode.commands.executeCommand(
'setContext',
'tailscale.walkthroughs.httpsOn',
isFunnelOn && isHTTPSOn
);

if (status?.ServeConfig && Object.keys(status.ServeConfig).length === 0) {
vscode.commands.executeCommand('setContext', 'tailscale.walkthroughs.sharedPort', true);
Expand Down

0 comments on commit a4e2d30

Please sign in to comment.