Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release/0.62.0 #1111

Merged
merged 8 commits into from
Jan 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 15 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,21 @@ All notable changes to this project will be documented in this file. Dates are d

Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).

#### [v0.62.0](https://github.com/isomerpages/isomercms-backend/compare/v0.61.0...v0.62.0)

- chore: update formsg sdk [`#1108`](https://github.com/isomerpages/isomercms-backend/pull/1108)
- Fix/privatisation quickie interaction [`#1094`](https://github.com/isomerpages/isomercms-backend/pull/1094)
- chore: copy instead of clone [`#1095`](https://github.com/isomerpages/isomercms-backend/pull/1095)
- updated GIG API swagger doc [`#1103`](https://github.com/isomerpages/isomercms-backend/pull/1103)
- fix: remove unnecessary push logs [`#1109`](https://github.com/isomerpages/isomercms-backend/pull/1109)
- fix(rr): skip checking the existence of review request [`#1102`](https://github.com/isomerpages/isomercms-backend/pull/1102)
- release/0.61.0 [`#1104`](https://github.com/isomerpages/isomercms-backend/pull/1104)
- fix(sl): include issuewild if CAA records are needed [`#1106`](https://github.com/isomerpages/isomercms-backend/pull/1106)

#### [v0.61.0](https://github.com/isomerpages/isomercms-backend/compare/v0.60.0...v0.61.0)

- fix(sl): include issuewild if CAA records are needed [`#1106`](https://github.com/isomerpages/isomercms-backend/pull/1106)
> 10 January 2024

- chore: upgrade axios [`#1100`](https://github.com/isomerpages/isomercms-backend/pull/1100)
- build(deps): bump follow-redirects from 1.15.2 to 1.15.4 [`#1101`](https://github.com/isomerpages/isomercms-backend/pull/1101)
- fix(ci): reverts ci changes to allow staging updates [`#1084`](https://github.com/isomerpages/isomercms-backend/pull/1084)
Expand Down Expand Up @@ -88,12 +100,12 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
- fix(siteCreate): add redirect rules [`#1036`](https://github.com/isomerpages/isomercms-backend/pull/1036)
- chore: remove extra and unused submodules [`#1031`](https://github.com/isomerpages/isomercms-backend/pull/1031)
- release/0.54.0 [`#1033`](https://github.com/isomerpages/isomercms-backend/pull/1033)
- fix: use cTimeMs instead of birthtime due to EFS [`#1035`](https://github.com/isomerpages/isomercms-backend/pull/1035)

#### [v0.54.0](https://github.com/isomerpages/isomercms-backend/compare/v0.53.0...v0.54.0)

> 14 November 2023

- fix: use cTimeMs instead of birthtime due to EFS [`#1035`](https://github.com/isomerpages/isomercms-backend/pull/1035)
- fix(pagination): total length [`#1032`](https://github.com/isomerpages/isomercms-backend/pull/1032)
- fix(staging-lite): apps were created for wrong br [`#1014`](https://github.com/isomerpages/isomercms-backend/pull/1014)
- fix(cm): extra timeout [`#1027`](https://github.com/isomerpages/isomercms-backend/pull/1027)
Expand Down Expand Up @@ -220,12 +232,12 @@ Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog).
- build(deps-dev): bump @babel/traverse from 7.22.8 to 7.23.2 [`#984`](https://github.com/isomerpages/isomercms-backend/pull/984)
- release/v0.48.0 [`#979`](https://github.com/isomerpages/isomercms-backend/pull/979)
- feat(staging-id): add column to store the id [`#983`](https://github.com/isomerpages/isomercms-backend/pull/983)
- Fix: collaborators service tests [`#978`](https://github.com/isomerpages/isomercms-backend/pull/978)

#### [v0.48.0](https://github.com/isomerpages/isomercms-backend/compare/v0.47.0...v0.48.0)

> 18 October 2023

- Fix: collaborators service tests [`#978`](https://github.com/isomerpages/isomercms-backend/pull/978)
- chore(commitService): proper naming [`#975`](https://github.com/isomerpages/isomercms-backend/pull/975)
- Feat/is 585 govt sgid login rollout [`#976`](https://github.com/isomerpages/isomercms-backend/pull/976)
- test(quickie): unit tests [`#973`](https://github.com/isomerpages/isomercms-backend/pull/973)
Expand Down
96 changes: 95 additions & 1 deletion docs/gigDnsApi.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,12 +35,18 @@ paths:
description: The contact email address for this DNS record.
record:
$ref: "#/components/schemas/DNSRecord"
rootDomain:
type: string
description: The root domain associated with this DNS record.
example: "example.com"
example:
email: "[email protected]"
record:
type: "A"
name: "example.com"
content: "192.168.1.1"
rootDomain: "example.com"

responses:
"201":
description: DNS record successfully added.
Expand Down Expand Up @@ -74,6 +80,81 @@ paths:
message:
type: string
example: "Internal server error."
put:
summary: Update a DNS record
description: Update an existing DNS record in the DNS management system.
security:
- ApiKeyAuth: []
parameters:
- in: header
name: X-API-KEY
required: true
schema:
type: string
description: API key required to authorize requests.
example: "1234567890abcdef"
requestBody:
required: true
content:
application/json:
schema:
type: object
required:
- email
- record
properties:
email:
type: string
format: email
description: The contact email address for this DNS record.
record:
$ref: "#/components/schemas/DNSRecord"
rootDomain:
type: string
description: The root domain associated with this DNS record.
example: "example.com"
example:
email: "[email protected]"
record:
type: "A"
name: "example.com"
content: "192.168.1.1"
rootDomain: "example.com"
responses:
"200":
description: DNS record successfully updated.
content:
application/json:
schema:
type: object
properties:
message:
type: string
example: "DNS record updated successfully."
"401":
description: Unauthorized.
"400":
description: Invalid request data.
content:
application/json:
schema:
type: object
properties:
message:
type: string
example: "Invalid data provided."
"404":
description: DNS record not found.
"500":
description: Server error.
content:
application/json:
schema:
type: object
properties:
message:
type: string
example: "Internal server error."
get:
summary: Retrieve DNS records
description: Get a list of DNS records for a specified name.
Expand Down Expand Up @@ -128,6 +209,19 @@ paths:
"DS",
]
description: The type of the DNS record to be deleted.
- in: query
name: rootDomain
required: false
schema:
type: string
description: The root domain associated with the DNS record to be deleted.
- in: query
name: email
required: true
schema:
type: string
format: email
description: The contact email address associated with the DNS record to be deleted.
responses:
"200":
description: DNS record successfully deleted.
Expand Down Expand Up @@ -227,4 +321,4 @@ components:
description: An 8-bit integer representing the type of the digest.
digest:
type: string
description: The digest value, encoded in Base64.
description: The digest value, encoded in Base64.
22 changes: 7 additions & 15 deletions package-lock.json

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

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "isomercms",
"version": "0.61.0",
"version": "0.62.0",
"private": true,
"scripts": {
"build": "tsc -p tsconfig.build.json",
Expand Down Expand Up @@ -32,7 +32,7 @@
"@growthbook/growthbook": "^0.27.0",
"@octokit/plugin-retry": "^6.0.0",
"@octokit/rest": "^18.12.0",
"@opengovsg/formsg-sdk": "^0.10.0",
"@opengovsg/formsg-sdk": "^0.11.0",
"@opengovsg/sgid-client": "^2.0.0",
"auto-bind": "^4.0.0",
"aws-lambda": "^1.0.7",
Expand Down
6 changes: 5 additions & 1 deletion src/routes/formsg/formsgGGsRepair.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,10 @@ import { ResultAsync, errAsync, fromPromise, okAsync } from "neverthrow"

import { config } from "@config/config"

import { EFS_VOL_PATH_STAGING_LITE } from "@root/constants"
import {
EFS_VOL_PATH_STAGING,
EFS_VOL_PATH_STAGING_LITE,
} from "@root/constants"
import GitFileSystemError from "@root/errors/GitFileSystemError"
import InitializationError from "@root/errors/InitializationError"
import { consoleLogger } from "@root/logger/console.logger"
Expand Down Expand Up @@ -147,6 +150,7 @@ export class FormsgGGsRepairRouter {
.andThen(() =>
fromPromise(
this.reposService.setUpStagingLite(
path.join(EFS_VOL_PATH_STAGING, repoName),
path.join(EFS_VOL_PATH_STAGING_LITE, repoName),
repoUrl
),
Expand Down
29 changes: 4 additions & 25 deletions src/routes/v2/authenticated/review.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1274,7 +1274,9 @@ export class ReviewsRouter {
{ userWithSiteSessionData: UserWithSiteSessionData }
> = async (req, res) => {
// Step 1: Check that the site exists
const { siteName, requestId } = req.params
// NOTE: We don't check for the existence of the review request, as we
// assume that we are comparing between the staging and master branch
const { siteName } = req.params
const { path } = req.query
const { userWithSiteSessionData } = res.locals
const site = await this.sitesService.getBySiteName(siteName)
Expand Down Expand Up @@ -1308,30 +1310,7 @@ export class ReviewsRouter {
})
}

// Step 2: Retrieve review request
const possibleReviewRequest = await this.reviewRequestService.getReviewRequest(
site.value,
requestId
)

if (isIsomerError(possibleReviewRequest)) {
logger.error({
message: "Invalid review request requested",
method: "getBlob",
meta: {
userId: userWithSiteSessionData.isomerUserId,
email: userWithSiteSessionData.email,
siteName,
requestId,
file: path,
},
})
return res.status(404).send({
message: "Please ensure that the site exists!",
})
}

// Step 3: Check if the user is a contributor of the site
// Step 2: Check if the user is a contributor of the site
const role = await this.collaboratorsService.getRole(
siteName,
userWithSiteSessionData.isomerUserId
Expand Down
14 changes: 9 additions & 5 deletions src/services/configServices/SettingsService.js
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,14 @@ class SettingsService {
// only when changing from public to private - not awaited as this is slow and non-blocking
privatiseNetlifySite(siteName, password)
}
const updatePasswordResp = await this.deploymentsService.updateAmplifyPassword(
siteName,
password,
enablePassword
)
if (updatePasswordResp.isErr()) {
return updatePasswordResp
}
if (isPrivate !== enablePassword) {
// For public -> private or private -> public, we also need to update the repo privacy on github
const privatiseRepoRes = await this.gitHubService.changeRepoPrivacy(
Expand All @@ -189,11 +197,7 @@ class SettingsService {
return errAsync(err)
}
}
return this.deploymentsService.updateAmplifyPassword(
siteName,
password,
enablePassword
)
return updatePasswordResp
}

shouldUpdateHomepage(updatedConfigContent, configContent) {
Expand Down
13 changes: 10 additions & 3 deletions src/services/db/GitFileSystemService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -539,7 +539,9 @@ export default class GitFileSystemService {
.cwd({ path: `${efsVolPath}/${repoName}`, root: false })
.push(gitOptions),
(error) => {
logger.error(`Error when pushing ${repoName}: ${error}`)
logger.error(
`Error when pushing ${repoName}. Retrying git push operation for the first time...`
)

if (error instanceof GitError) {
return new GitFileSystemError(
Expand All @@ -562,7 +564,9 @@ export default class GitFileSystemService {
.cwd({ path: `${efsVolPath}/${repoName}`, root: false })
.push(gitOptions),
(error) => {
logger.error(`Error when pushing ${repoName}: ${error}`)
logger.error(
`Error when pushing ${repoName}. Retrying git push operation for the second time...`
)

if (error instanceof GitError) {
return new GitFileSystemError(
Expand All @@ -576,6 +580,7 @@ export default class GitFileSystemService {
)
.orElse(() =>
// Retry push twice
// TODO: To eliminate duplicate code by using a backoff or retry package
ResultAsync.fromPromise(
isForce
? this.git
Expand All @@ -585,7 +590,9 @@ export default class GitFileSystemService {
.cwd({ path: `${efsVolPath}/${repoName}`, root: false })
.push(gitOptions),
(error) => {
logger.error(`Error when pushing ${repoName}: ${error}`)
logger.error(
`Both retries for git push have failed. Error when pushing ${repoName}: ${error}`
)

if (error instanceof GitError) {
return new GitFileSystemError(
Expand Down
Loading
Loading