Skip to content

Commit

Permalink
FAH bugfixes (#6754)
Browse files Browse the repository at this point in the history
* FAH bugfixes

* Changelog
  • Loading branch information
inlined authored Feb 9, 2024
1 parent ae24af6 commit 0d975e3
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 4 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Bugfixes to internal utilities (#6754)
4 changes: 2 additions & 2 deletions src/commands/apphosting-builds-create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,12 @@ export const command = new Command("apphosting:builds:create <backendId>")
const buildId =
(options.buildId as string) ||
(await apphosting.getNextRolloutId(projectId, location, backendId));
const branch = options.branch as string;
const branch = (options.branch as string | undefined) ?? "main";

const op = await apphosting.createBuild(projectId, location, backendId, buildId, {
source: {
codebase: {
branch: "main",
branch,
},
},
});
Expand Down
2 changes: 1 addition & 1 deletion src/gcp/apphosting.ts
Original file line number Diff line number Diff line change
Expand Up @@ -531,7 +531,7 @@ export async function getNextRolloutId(
const year = date.getUTCFullYear();
// Note: month is 0 based in JS
const month = String(date.getUTCMonth() + 1).padStart(2, "0");
const day = String(date.getUTCDay()).padStart(2, "0");
const day = String(date.getUTCDate()).padStart(2, "0");

if (counter) {
return `build-${year}-${month}-${day}-${String(counter).padStart(3, "0")}`;
Expand Down
2 changes: 1 addition & 1 deletion src/test/gcp/apphosting.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ describe("apphosting", () => {
function idPrefix(date: Date): string {
const year = date.getUTCFullYear();
const month = String(date.getUTCMonth() + 1).padStart(2, "0");
const day = String(date.getUTCDay()).padStart(2, "0");
const day = String(date.getUTCDate()).padStart(2, "0");
return `build-${year}-${month}-${day}`;
}

Expand Down

0 comments on commit 0d975e3

Please sign in to comment.