From e8762f258e8b81d0a8da0b8062e7352722948e6c Mon Sep 17 00:00:00 2001 From: Autofix Date: Wed, 9 Jun 2021 03:04:51 +0000 Subject: [PATCH] Autofix: trailing-spaces --- components/dashboard/src/App.tsx | 2 +- components/ee/db-sync/src/main.ts | 4 +-- components/ee/payment-endpoint/package.json | 2 +- .../src/accounting/account-service-impl.ts | 4 +-- .../src/accounting/account-service.spec.db.ts | 2 +- .../src/accounting/accounting-util.spec.ts | 4 +-- .../src/accounting/accounting-util.ts | 2 +- .../src/accounting/subscription-service.ts | 12 ++++----- .../src/chargebee/chargebee-event-handler.ts | 2 +- .../src/chargebee/chargebee-types.ts | 6 ++--- .../src/chargebee/subscription-handler.ts | 2 +- .../src/chargebee/subscription-mapper.spec.ts | 4 +-- .../chargebee/team-subscription-handler.ts | 2 +- .../src/chargebee/upgrade-helper.ts | 12 ++++----- components/ee/payment-endpoint/src/main.ts | 2 +- components/gitpod-cli/cmd/init.go | 2 +- components/gitpod-db/README.md | 4 +-- .../gitpod-db/src/accounting-db.spec.db.ts | 4 +-- .../gitpod-db/src/typeorm/email-db-impl.ts | 2 +- .../src/typeorm/entity/db-subscription.ts | 8 +++--- .../src/typeorm/team-subscription-db-impl.ts | 2 +- .../gitpod-db/src/typeorm/user-db-impl.ts | 2 +- components/local-app-api/go/BUILD.yaml | 2 +- components/server/ee/src/container-module.ts | 6 ++--- .../ee/src/user/account-statement-provider.ts | 2 +- .../src/user/eligibility-service.spec.db.ts | 4 +-- .../server/ee/src/user/eligibility-service.ts | 26 +++++++++---------- components/server/ee/src/user/user-service.ts | 2 +- .../ee/src/workspace/workspace-starter.ts | 2 +- .../src/auth/login-completion-handler.ts | 6 ++--- components/server/src/container-module.ts | 2 +- .../src/github/github-context-parser.spec.ts | 2 +- .../oauth-authorization-server.ts | 2 +- components/server/src/user/user-controller.ts | 2 +- .../server/src/workspace/workspace-starter.ts | 6 ++--- .../cluster-service.proto | 8 +++--- components/ws-manager-bridge/src/bridge.ts | 10 +++---- .../src/cluster-service-server.ts | 2 +- 38 files changed, 85 insertions(+), 85 deletions(-) diff --git a/components/dashboard/src/App.tsx b/components/dashboard/src/App.tsx index 7a36467974aaa4..eaa73ab16f1dde 100644 --- a/components/dashboard/src/App.tsx +++ b/components/dashboard/src/App.tsx @@ -179,7 +179,7 @@ function App() { { - + return isGitpodIo() ? // delegate to our website to handle the request (window.location.host = 'www.gitpod.io') : diff --git a/components/ee/db-sync/src/main.ts b/components/ee/db-sync/src/main.ts index 67e27cb82a7232..d94f4c417cd1ce 100644 --- a/components/ee/db-sync/src/main.ts +++ b/components/ee/db-sync/src/main.ts @@ -18,7 +18,7 @@ const parser = new ArgumentParser({ addHelp: true, description: "Process for synchronising a cache database with a central master" }); -const subparser = parser.addSubparsers({ +const subparser = parser.addSubparsers({ title: 'commands', dest: 'cmd' }); @@ -38,7 +38,7 @@ container.load(productionContainerModule); let commands = container.getAll(ICommand) as ICommand[]; commands.forEach(c => { - const cmdparser = subparser.addParser(c.name, { + const cmdparser = subparser.addParser(c.name, { addHelp: true , help: c.help }); diff --git a/components/ee/payment-endpoint/package.json b/components/ee/payment-endpoint/package.json index 4ebf5dd7862898..d236f32aa7a400 100644 --- a/components/ee/payment-endpoint/package.json +++ b/components/ee/payment-endpoint/package.json @@ -22,7 +22,7 @@ "devDependencies": { "@types/body-parser": "^1.16.5", "@types/jsonwebtoken": "^8.3.2", - "@types/passport-http": "^0.3.0", + "@types/passport-http": "^0.3.0", "@types/chai": "^4.2.2", "@types/node-fetch": "^2.5.0", "chai": "^4.1.2", diff --git a/components/ee/payment-endpoint/src/accounting/account-service-impl.ts b/components/ee/payment-endpoint/src/accounting/account-service-impl.ts index 321bfe4159015b..42bc53c5949b76 100644 --- a/components/ee/payment-endpoint/src/accounting/account-service-impl.ts +++ b/components/ee/payment-endpoint/src/accounting/account-service-impl.ts @@ -52,9 +52,9 @@ export class AccountServiceImpl implements AccountService { // Gather all expected changes to our credits from now (statement.endDate) into the future const projectedCreditChanges = this.projectCreditChanges(statement, considerNextPeriod); const creditChangesSorted = new SortedArray(projectedCreditChanges, (c1, c2) => orderByDateAscPosFirst(c1, c2)); - + // Starting point: the credits we have now are the cummulated remainingAmounts of all credits in the statement - // that are still valid at statement.endDate + // that are still valid at statement.endDate const creditsNow = statement.credits .filter(c => within(statement.endDate, c)) .reduce((v, c) => (v + (c.remainingAmount !== undefined ? c.remainingAmount : c.amount)), 0); diff --git a/components/ee/payment-endpoint/src/accounting/account-service.spec.db.ts b/components/ee/payment-endpoint/src/accounting/account-service.spec.db.ts index 4c2e7ca38b3b31..b3b71e1191e023 100644 --- a/components/ee/payment-endpoint/src/accounting/account-service.spec.db.ts +++ b/components/ee/payment-endpoint/src/accounting/account-service.spec.db.ts @@ -94,7 +94,7 @@ const end = new Date(Date.UTC(2000, 2, 1)).toISOString(); // The following is a bug where we did not calculate the current remainingHours properly. // In case someone cancelled two subscriptions (with equal hours) + regular usage within on month time frame - // they would run out of hours, regardless of having an unlimited plan. + // they would run out of hours, regardless of having an unlimited plan. const subscription = async (plan: Plan, startDate: string, endDate?: string) => { const s = await this.accountingDb.newSubscription({ userId: 'Sven', diff --git a/components/ee/payment-endpoint/src/accounting/accounting-util.spec.ts b/components/ee/payment-endpoint/src/accounting/accounting-util.spec.ts index 4f9141adebf450..b6a73512b124d3 100644 --- a/components/ee/payment-endpoint/src/accounting/accounting-util.spec.ts +++ b/components/ee/payment-endpoint/src/accounting/accounting-util.spec.ts @@ -31,12 +31,12 @@ const s8 = { startDate: '2018-11-27T15:25:48.000Z', endDate: undefined } as Subs expect([s1, s2].sort(orderByEndDateDescThenStartDateDesc)).to.deep.equal([s2, s1]); expect([s2, s1].sort(orderByEndDateDescThenStartDateDesc)).to.deep.equal([s2, s1]); } - + @test test_orderByEndDateDescThenStartDateDesc_sameEndDate() { expect([s2, s3].sort(orderByEndDateDescThenStartDateDesc)).to.deep.equal([s2, s3]); expect([s3, s2].sort(orderByEndDateDescThenStartDateDesc)).to.deep.equal([s2, s3]); } - + @test test_orderByEndDateDescThenStartDateDesc_sameStartDate() { expect([s1, s3].sort(orderByEndDateDescThenStartDateDesc)).to.deep.equal([s3, s1]); expect([s3, s1].sort(orderByEndDateDescThenStartDateDesc)).to.deep.equal([s3, s1]); diff --git a/components/ee/payment-endpoint/src/accounting/accounting-util.ts b/components/ee/payment-endpoint/src/accounting/accounting-util.ts index 58c6465960c3a5..8026f1a23976db 100644 --- a/components/ee/payment-endpoint/src/accounting/accounting-util.ts +++ b/components/ee/payment-endpoint/src/accounting/accounting-util.ts @@ -44,7 +44,7 @@ export class SortedArray { protected readonly comparator: (t1: T, t2: T) => number) { this.array.sort(this.comparator); } - + push(t: T) { this.array.push(t); this.array.sort(this.comparator); diff --git a/components/ee/payment-endpoint/src/accounting/subscription-service.ts b/components/ee/payment-endpoint/src/accounting/subscription-service.ts index 96bffe55bc057b..1260d67dbf09b9 100644 --- a/components/ee/payment-endpoint/src/accounting/subscription-service.ts +++ b/components/ee/payment-endpoint/src/accounting/subscription-service.ts @@ -73,12 +73,12 @@ export class SubscriptionService { return this.accountingDB.transaction(async db => { await this.doUnsubscribe(db, userId, startDate, plan.chargebeeId); - const newSubscription = { - userId, - amount: Plans.getHoursPerMonth(plan), - planId: plan.chargebeeId, - paymentReference, - startDate, + const newSubscription = { + userId, + amount: Plans.getHoursPerMonth(plan), + planId: plan.chargebeeId, + paymentReference, + startDate, endDate }; log.info({ userId }, 'Creating subscription', { subscription: newSubscription }); return db.newSubscription(newSubscription); diff --git a/components/ee/payment-endpoint/src/chargebee/chargebee-event-handler.ts b/components/ee/payment-endpoint/src/chargebee/chargebee-event-handler.ts index ad270eea9e84f3..67fc6ba841ed27 100644 --- a/components/ee/payment-endpoint/src/chargebee/chargebee-event-handler.ts +++ b/components/ee/payment-endpoint/src/chargebee/chargebee-event-handler.ts @@ -17,7 +17,7 @@ export interface EventHandler { @injectable() export class CompositeEventHandler { @multiInject(EventHandler) @optional() protected readonly _handlers?: EventHandler[]; - + async handle(event: any): Promise { const handlers = this._handlers || []; diff --git a/components/ee/payment-endpoint/src/chargebee/chargebee-types.ts b/components/ee/payment-endpoint/src/chargebee/chargebee-types.ts index 5fbf15295884b6..c4aa293449f627 100644 --- a/components/ee/payment-endpoint/src/chargebee/chargebee-types.ts +++ b/components/ee/payment-endpoint/src/chargebee/chargebee-types.ts @@ -18,7 +18,7 @@ export namespace Chargebee { // A more specific code allowing you to handle the specific errors. api_error_code: string; - + /** * An optional attribute which is filled if the error was due to a specific parameter. The parameter name format that is sent is based on the underlying Chargebee's REST api format which can be referred in cURL api documentation. * For example, in create subscription for a customer API call if the plan referred in the plan_id parameter is not present in the site, then param value set as plan_id. For 'multivalued' parameters , the index is part of the parameter name. For the same API, if the second addon id is wrongly passed then the param value is set as addons[id][2]. @@ -250,7 +250,7 @@ export namespace Chargebee { applied_count: number; /* - * The coupon code used to redeem the coupon. + * The coupon code used to redeem the coupon. * Will be present only when associated code for a coupon is used. */ coupon_code?: string; @@ -450,7 +450,7 @@ export namespace Chargebee { export type PaymentSourceStatus = "valid" | "expiring" | "expired" | "invalid" | "pending_verification"; /** // There are a gazillion other types not listed here for brevity: https://apidocs.chargebee.com/docs/api/payment_sources#payment_source_gateway */ export type Gateway = "chargebee" | "stripe"; - + export interface BankAccount { // not relevant yet } diff --git a/components/ee/payment-endpoint/src/chargebee/subscription-handler.ts b/components/ee/payment-endpoint/src/chargebee/subscription-handler.ts index edf16dcb27c2f7..d93087fea852f0 100644 --- a/components/ee/payment-endpoint/src/chargebee/subscription-handler.ts +++ b/components/ee/payment-endpoint/src/chargebee/subscription-handler.ts @@ -49,7 +49,7 @@ export class SubscriptionHandler implements EventHandler): Promise { const chargebeeSubscription = event.content.subscription; const userId = chargebeeSubscription.customer_id; diff --git a/components/ee/payment-endpoint/src/chargebee/upgrade-helper.ts b/components/ee/payment-endpoint/src/chargebee/upgrade-helper.ts index 0b3aed9e7c4cdb..58bf34fc481527 100644 --- a/components/ee/payment-endpoint/src/chargebee/upgrade-helper.ts +++ b/components/ee/payment-endpoint/src/chargebee/upgrade-helper.ts @@ -15,12 +15,12 @@ export class UpgradeHelper { /** * Uses subscription.add_charge_at_term_end to 'manually' add a charge to the given Chargebee Subscription * (see https://apidocs.chargebee.com/docs/api/subscriptions#add_charge_at_term_end) - * - * @param userId - * @param chargebeeSubscriptionId - * @param amountInCents - * @param description - * @param upgradeTimestamp + * + * @param userId + * @param chargebeeSubscriptionId + * @param amountInCents + * @param description + * @param upgradeTimestamp */ async chargeForUpgrade(userId: string, chargebeeSubscriptionId: string, amountInCents: number, description: string, upgradeTimestamp: string) { const logContext: LogContext = { userId }; diff --git a/components/ee/payment-endpoint/src/main.ts b/components/ee/payment-endpoint/src/main.ts index c328bdff9ee820..35fdb1f07db81d 100644 --- a/components/ee/payment-endpoint/src/main.ts +++ b/components/ee/payment-endpoint/src/main.ts @@ -20,7 +20,7 @@ const init = async () => { const container = new Container(); container.load(productionContainerModule); container.load(dbContainerModule); - + const server = container.get(Server); const app = express(); diff --git a/components/gitpod-cli/cmd/init.go b/components/gitpod-cli/cmd/init.go index 194dcce6b5d815..56fb84e17d0b01 100644 --- a/components/gitpod-cli/cmd/init.go +++ b/components/gitpod-cli/cmd/init.go @@ -56,7 +56,7 @@ Create a Gitpod configuration for this project. tasks: - init: echo 'init script' # runs during prebuild command: echo 'start script' - + # List the ports to expose. Learn more https://www.gitpod.io/docs/config-ports/ ports: - port: 3000 diff --git a/components/gitpod-db/README.md b/components/gitpod-db/README.md index 505c969c9a7e3a..0bf564fe6f2038 100644 --- a/components/gitpod-db/README.md +++ b/components/gitpod-db/README.md @@ -4,9 +4,9 @@ Contains all the database related functionality, implemented using [typeorm](htt ### Adding a new table 1. Create a [migration](./src/typeorm/migration/README.md) - use the [baseline](./src/typeorm/migration/1592203031938-Baseline.ts) as an exemplar -1. Create a new entity that implements the requisite interface or extend an existing entity as required - see [db-user.ts](./src/typeorm/entity/db-user.ts) +1. Create a new entity that implements the requisite interface or extend an existing entity as required - see [db-user.ts](./src/typeorm/entity/db-user.ts) 1. If it is a new table, create the matching injectable ORM implementation and interface (if required) - see [user-db-impl.ts](./src/typeorm/user-db-impl.ts) and [user-db.ts](./src/user-db.ts). Otherwise extend the existing interface and implementation as required. -1. Add the injectable implementation to the [DB container module](./src/container-module.ts), binding the interface and implementation as appropriate, otherwise it will not be instantiated correctly e.g. +1. Add the injectable implementation to the [DB container module](./src/container-module.ts), binding the interface and implementation as appropriate, otherwise it will not be instantiated correctly e.g. ``` bind(TypeORMUserDBImpl).toSelf().inSingletonScope(); bind(UserDB).toService(TypeORMUserDBImpl); diff --git a/components/gitpod-db/src/accounting-db.spec.db.ts b/components/gitpod-db/src/accounting-db.spec.db.ts index d40265e9f45221..6dea7f07d2d3ea 100644 --- a/components/gitpod-db/src/accounting-db.spec.db.ts +++ b/components/gitpod-db/src/accounting-db.spec.db.ts @@ -33,7 +33,7 @@ export class AccountingDBSpec { await manager.clear(DBSubscription); await manager.clear(DBWorkspaceInstance); await manager.clear(DBWorkspace); - + this.queryRunner = connection.createQueryRunner(); await this.queryRunner.connect(); await this.queryRunner.startTransaction(); @@ -132,7 +132,7 @@ export class AccountingDBSpec { expectExactlyOne(await this.db.findActiveSubscriptionsForUser(subscription.userId, later), subscription); Subscription.cancelSubscription(dbSubscription, later); await this.db.storeSubscription(dbSubscription); - + expectExactlyOne(await this.db.findActiveSubscriptionsForUser(subscription.userId, rightBefore(later)), dbSubscription); expect(await this.db.findActiveSubscriptionsForUser(subscription.userId, later)).to.be.an('array').and.empty; } diff --git a/components/gitpod-db/src/typeorm/email-db-impl.ts b/components/gitpod-db/src/typeorm/email-db-impl.ts index 4066a2faab2609..2a5f37d90d589f 100644 --- a/components/gitpod-db/src/typeorm/email-db-impl.ts +++ b/components/gitpod-db/src/typeorm/email-db-impl.ts @@ -43,7 +43,7 @@ export class TypeORMEMailDBImpl implements EMailDB { return await query.getMany(); } - + async findEMailsByCampaignAndUserId(campaignId: string, userId: string): Promise { const repo = await this.getEMailRepo(); const qb = repo.createQueryBuilder('email') diff --git a/components/gitpod-db/src/typeorm/entity/db-subscription.ts b/components/gitpod-db/src/typeorm/entity/db-subscription.ts index 8dd2c73394068c..bbcc8bc854a406 100644 --- a/components/gitpod-db/src/typeorm/entity/db-subscription.ts +++ b/components/gitpod-db/src/typeorm/entity/db-subscription.ts @@ -95,7 +95,7 @@ export class DBSubscriptionAdditionalData { transformer: Transformer.MAP_EMPTY_STR_TO_UNDEFINED }) nextBilling?: string; - + @Column({ type: 'timestamp', precision: 6, @@ -111,8 +111,8 @@ export interface CouponData { coupon_id: string; /* - * The date till the coupon is to be applied. - * Applicable for "limited months" coupons. + * The date till the coupon is to be applied. + * Applicable for "limited months" coupons. * optional, timestamp(UTC) in seconds */ apply_till?: number; @@ -123,7 +123,7 @@ export interface CouponData { applied_count: number; /* - * The coupon code used to redeem the coupon. + * The coupon code used to redeem the coupon. * Will be present only when associated code for a coupon is used. */ coupon_code?: string; diff --git a/components/gitpod-db/src/typeorm/team-subscription-db-impl.ts b/components/gitpod-db/src/typeorm/team-subscription-db-impl.ts index 60cdb5bcb8f1a7..101299fdaa79c7 100644 --- a/components/gitpod-db/src/typeorm/team-subscription-db-impl.ts +++ b/components/gitpod-db/src/typeorm/team-subscription-db-impl.ts @@ -63,7 +63,7 @@ export class TeamSubscriptionDBImpl implements TeamSubscriptionDB { .andWhere('ts.endDate = "" OR ts.endDate > :date', { date: date }); return query.getMany(); } - + async findTeamSubscriptions(partial: DeepPartial): Promise { const repo = await this.getRepo(); return repo.find(partial); diff --git a/components/gitpod-db/src/typeorm/user-db-impl.ts b/components/gitpod-db/src/typeorm/user-db-impl.ts index 21619a07eaf748..2fe6e7a035a5d1 100644 --- a/components/gitpod-db/src/typeorm/user-db-impl.ts +++ b/components/gitpod-db/src/typeorm/user-db-impl.ts @@ -400,7 +400,7 @@ export class TypeORMUserDBImpl implements UserDB { const userAndToken = await this.findUserByGitpodToken(tokenHash); if (userAndToken) { // Yes, update it (~) - // NOTE(rl): as we don't support refresh tokens yet this is not really required + // NOTE(rl): as we don't support refresh tokens yet this is not really required // since the OAuth server lib calls issueRefreshToken immediately after issueToken // We do not allow changes of name, type, user or scope. dbToken = userAndToken.token as GitpodToken & { user: DBUser }; diff --git a/components/local-app-api/go/BUILD.yaml b/components/local-app-api/go/BUILD.yaml index 7cc58309a200e1..7f8c61800b257b 100644 --- a/components/local-app-api/go/BUILD.yaml +++ b/components/local-app-api/go/BUILD.yaml @@ -10,4 +10,4 @@ packages: dontTest: false deps: - components/supervisor-api/go:lib - + diff --git a/components/server/ee/src/container-module.ts b/components/server/ee/src/container-module.ts index a89c3d11ccdcf6..a431bcc344ebec 100644 --- a/components/server/ee/src/container-module.ts +++ b/components/server/ee/src/container-module.ts @@ -37,9 +37,9 @@ import { MonitoringEndpointsApp } from "../../src/monitoring-endpoints"; import { WorkspaceHealthMonitoring } from "./workspace/workspace-health-monitoring"; import { EnvEE } from "./env"; import { Env } from "../../src/env"; -import { AccountService } from "@gitpod/gitpod-payment-endpoint/lib/accounting/account-service"; -import { AccountServiceImpl, SubscriptionService, TeamSubscriptionService } from "@gitpod/gitpod-payment-endpoint/lib/accounting"; -import { ChargebeeProvider, ChargebeeProviderOptions, UpgradeHelper } from "@gitpod/gitpod-payment-endpoint/lib/chargebee"; +import { AccountService } from "@gitpod/gitpod-payment-endpoint/lib/accounting/account-service"; +import { AccountServiceImpl, SubscriptionService, TeamSubscriptionService } from "@gitpod/gitpod-payment-endpoint/lib/accounting"; +import { ChargebeeProvider, ChargebeeProviderOptions, UpgradeHelper } from "@gitpod/gitpod-payment-endpoint/lib/chargebee"; import { ChargebeeCouponComputer } from "./user/coupon-computer"; import { ChargebeeService } from "./user/chargebee-service"; import { EligibilityService } from "./user/eligibility-service"; diff --git a/components/server/ee/src/user/account-statement-provider.ts b/components/server/ee/src/user/account-statement-provider.ts index fc6a82c729fd7d..9f557c93309988 100644 --- a/components/server/ee/src/user/account-statement-provider.ts +++ b/components/server/ee/src/user/account-statement-provider.ts @@ -19,7 +19,7 @@ export type CachedAccountStatement = Pick): Promise { if (!this.env.enablePayment) { @@ -207,7 +207,7 @@ export class EligibilityService { * - has a paid subscription * - has assigned team subscription * @param user - * @param context + * @param context * @param date The date for which we want to know whether the user is allowed to set a timeout (depends on active subscription) */ async mayOpenContext(user: User, context: WorkspaceContext, date: Date): Promise { @@ -254,11 +254,11 @@ export class EligibilityService { return this.subscriptionService.hasActiveAndNotYetCancelledPaidSubscription(user.id, date); } - + /** * Marks the users free private repo trial as started _now_ (if not already set) - * @param user - * @param now + * @param user + * @param now */ protected async ensureFreePrivateRepoTrialStarted(user: User, now: string): Promise { // If user has not yet started his free private repo trial yet: do that @@ -288,8 +288,8 @@ export class EligibilityService { /** * the time left for the trial in milliseconds or `undefined` if the trial hasn't started or the user already has a paid subscription. * A negative number denotes the milliseconds the trial is over. - * - * @param user + * + * @param user * @param date The date for which we want to know how much time the user has left (depends on active subscription) */ async getPrivateRepoTrialTimeLeft(user: User, date: Date = new Date()): Promise { @@ -305,8 +305,8 @@ export class EligibilityService { /** * End date for the users free private trial or `undefined` if the trial hasn't started or the user already has a paid subscription. - * - * @param user + * + * @param user * @param date The date for which we want to know how much time the user has left (depends on active subscription) */ async getPrivateRepoTrialEndDate(user: User, date: Date = new Date()): Promise { @@ -322,7 +322,7 @@ export class EligibilityService { /** * A user may set the workspace timeout if they have a professional subscription - * @param user + * @param user * @param date The date for which we want to know whether the user is allowed to set a timeout (depends on active subscription) */ async maySetTimeout(user: User, date: Date = new Date()): Promise { diff --git a/components/server/ee/src/user/user-service.ts b/components/server/ee/src/user/user-service.ts index bb5879244799d0..f1b68d767840ca 100644 --- a/components/server/ee/src/user/user-service.ts +++ b/components/server/ee/src/user/user-service.ts @@ -47,7 +47,7 @@ export class UserServiceEE extends UserService { /////////////////////////////////////////////////////////////////////////// // Currently, we don't check for ToS on login. /////////////////////////////////////////////////////////////////////////// - + return false; } diff --git a/components/server/ee/src/workspace/workspace-starter.ts b/components/server/ee/src/workspace/workspace-starter.ts index 3b3de15726b7ed..26d7f497bf07b4 100644 --- a/components/server/ee/src/workspace/workspace-starter.ts +++ b/components/server/ee/src/workspace/workspace-starter.ts @@ -15,7 +15,7 @@ export class WorkspaceStarterEE extends WorkspaceStarter { /** * Creates a new instance for a given workspace and its owner - * + * * @param workspace the workspace to create an instance for */ protected async newInstance(workspace: Workspace, user: User, excludeFeatureFlags: NamedWorkspaceFeatureFlag[]): Promise { diff --git a/components/server/src/auth/login-completion-handler.ts b/components/server/src/auth/login-completion-handler.ts index 45461a9d809a10..34271334fce148 100644 --- a/components/server/src/auth/login-completion-handler.ts +++ b/components/server/src/auth/login-completion-handler.ts @@ -81,15 +81,15 @@ export class LoginCompletionHandler { if (authHost) { increaseLoginCounter("succeeded", authHost); this.analytics.identify({ anonymousId: request.sessionID, userId: user.id }); - this.analytics.track({ - userId: user.id, + this.analytics.track({ + userId: user.id, event: "login", properties: { "loginContext": authHost, "location": (request.header as any)["x-glb-client-city-lat-long"] } }); - } + } response.redirect(returnTo); } diff --git a/components/server/src/container-module.ts b/components/server/src/container-module.ts index e7688bfca4bf0f..13cad1ab6c6603 100644 --- a/components/server/src/container-module.ts +++ b/components/server/src/container-module.ts @@ -188,6 +188,6 @@ export const productionContainerModule = new ContainerModule((bind, unbind, isBo bind(CodeSyncService).toSelf().inSingletonScope(); bind(IAnalyticsWriter).toDynamicValue(newAnalyticsWriterFromEnv).inSingletonScope(); - + bind(OAuthController).toSelf().inSingletonScope(); }); diff --git a/components/server/src/github/github-context-parser.spec.ts b/components/server/src/github/github-context-parser.spec.ts index 13d2a7689d1f67..66ab79853c8530 100644 --- a/components/server/src/github/github-context-parser.spec.ts +++ b/components/server/src/github/github-context-parser.spec.ts @@ -438,7 +438,7 @@ class TestGithubContextParser { } ) } - + @test public async testIssuePageContext() { const result = await this.parser.handle({}, this.user, 'https://github.com/gitpod-io/gitpod-test-repo/issues'); expect(result).to.deep.include( diff --git a/components/server/src/oauth-server/oauth-authorization-server.ts b/components/server/src/oauth-server/oauth-authorization-server.ts index 61ea6f117a18c5..d992887fd49776 100644 --- a/components/server/src/oauth-server/oauth-authorization-server.ts +++ b/components/server/src/oauth-server/oauth-authorization-server.ts @@ -23,7 +23,7 @@ export function createAuthorizationServer(authCodeRepository: OAuthAuthCodeRepos new JwtService(jwtSecret), { // Be explicit, communicate intent. Default is true but let's not assume that - requiresPKCE: true, + requiresPKCE: true, } ); diff --git a/components/server/src/user/user-controller.ts b/components/server/src/user/user-controller.ts index 306986937a0758..8149dd320b0b80 100644 --- a/components/server/src/user/user-controller.ts +++ b/components/server/src/user/user-controller.ts @@ -511,7 +511,7 @@ export class UserController { await this.userService.updateUserEnvVarsOnLogin(user, envVars); await this.userService.acceptCurrentTerms(user); this.analytics.identify({ anonymousId: req.sessionID || "unknown", userId: user.id, }); - this.analytics.track({ + this.analytics.track({ userId: user.id, event: "signup", properties: { diff --git a/components/server/src/workspace/workspace-starter.ts b/components/server/src/workspace/workspace-starter.ts index b1a8f222148695..8d15913aa9849b 100644 --- a/components/server/src/workspace/workspace-starter.ts +++ b/components/server/src/workspace/workspace-starter.ts @@ -176,9 +176,9 @@ export class WorkspaceStarter { const resp = (await manager.startWorkspace({ span }, startRequest)).toObject(); span.log({ "resp": resp }); - this.analytics.track({ - userId: user.id, - event: "workspace-started", + this.analytics.track({ + userId: user.id, + event: "workspace-started", properties: { workspaceId: workspace.id, instanceId: instance.id, diff --git a/components/ws-manager-bridge-api/cluster-service.proto b/components/ws-manager-bridge-api/cluster-service.proto index c3e07002d6f46b..a0c4842c834d33 100644 --- a/components/ws-manager-bridge-api/cluster-service.proto +++ b/components/ws-manager-bridge-api/cluster-service.proto @@ -90,14 +90,14 @@ message ModifyAdmissionConstraint { message UpdateResponse {} -message DeregisterRequest { - string name = 1; +message DeregisterRequest { + string name = 1; } message DeregisterResponse {} message ListRequest {} -message ListResponse { - repeated ClusterStatus status = 1; +message ListResponse { + repeated ClusterStatus status = 1; } diff --git a/components/ws-manager-bridge/src/bridge.ts b/components/ws-manager-bridge/src/bridge.ts index 879e27c0510d08..759ce6c3b6713b 100644 --- a/components/ws-manager-bridge/src/bridge.ts +++ b/components/ws-manager-bridge/src/bridge.ts @@ -50,7 +50,7 @@ export class WorkspaceManagerBridge implements Disposable { @inject(Configuration) protected readonly config: Configuration; - @inject(IAnalyticsWriter) + @inject(IAnalyticsWriter) protected readonly analytics: IAnalyticsWriter; protected readonly disposables: Disposable[] = []; @@ -324,11 +324,11 @@ export class WorkspaceManagerBridge implements Disposable { try { await this.userDB.trace({span}).deleteGitpodTokensNamedLike(ownerUserID, `${instance.id}-%`); - await this.analytics.track({ - userId: ownerUserID, - event: "workspace-stopped", + await this.analytics.track({ + userId: ownerUserID, + event: "workspace-stopped", messageId: `bridge-wsstopped-${instance.id}`, - properties: { "instanceId": instance.id, "workspaceId": instance.workspaceId } + properties: { "instanceId": instance.id, "workspaceId": instance.workspaceId } }); } catch (err) { TraceContext.logError({span}, err); diff --git a/components/ws-manager-bridge/src/cluster-service-server.ts b/components/ws-manager-bridge/src/cluster-service-server.ts index 0aae265bbaf370..fdb3a090ae1b17 100644 --- a/components/ws-manager-bridge/src/cluster-service-server.ts +++ b/components/ws-manager-bridge/src/cluster-service-server.ts @@ -198,7 +198,7 @@ export class ClusterService implements IClusterServiceServer { this.queue.enqueue(async () => { try { const req = call.request.toObject(); - + const instances = await this.workspaceDB.findRegularRunningInstances(); const relevantInstances = instances.filter(i => i.region === req.name); if (relevantInstances.length > 0) {