Skip to content

Commit

Permalink
Merge pull request #4623 from coralproject/develop
Browse files Browse the repository at this point in the history
v9.0.7
  • Loading branch information
tessalt authored Jun 3, 2024
2 parents 3cad9ae + 1df2c6e commit 9b5d878
Show file tree
Hide file tree
Showing 8 changed files with 28 additions and 12 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/build-and-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3
- uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.REPO_PATCHED_DEPLOY_KEY }}
Expand Down Expand Up @@ -85,7 +85,7 @@ jobs:
run: cd client && ./node_modules/.bin/bundlesize --enable-github-checks
# Build tag push the image after a merge to develop
- name: Build, Tag, Push
uses: docker/build-push-action@v4
uses: docker/build-push-action@v5
if: github.ref == 'refs/heads/develop'
with:
push: true
Expand All @@ -96,7 +96,7 @@ jobs:
cache-to: type=registry,ref=${{ env.IMAGE_CACHE_REPOSITORY }}:cache-develop
# Build tag push the release candidate image when the branch name begins with release-
- name: Build, Tag, Push RC
uses: docker/build-push-action@v4
uses: docker/build-push-action@v5
if: startsWith( github.ref, 'refs/heads/release-')
with:
push: true
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/build-test-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
uses: docker/setup-buildx-action@v3
- uses: webfactory/[email protected]
with:
ssh-private-key: ${{ secrets.REPO_PATCHED_DEPLOY_KEY }}
Expand Down Expand Up @@ -98,7 +98,7 @@ jobs:
echo "MINOR_TAG=${MAJOR}.${MINOR}" >> $GITHUB_ENV
echo "PATCH_TAG=${MAJOR}.${MINOR}.${PATCH}" >> $GITHUB_ENV
- name: Build, Tag, Push Major Tag
uses: docker/build-push-action@v4
uses: docker/build-push-action@v5
with:
push: true
tags: ${{ env.IMAGE_REPOSITORY }}:${{ env.MAJOR_TAG }}
Expand All @@ -107,7 +107,7 @@ jobs:
cache-from: type=registry,ref=${{ env.IMAGE_CACHE_REPOSITORY }}:cache-major
cache-to: type=registry,ref=${{ env.IMAGE_CACHE_REPOSITORY }}:cache-major
- name: Build, Tag, Push Minor Tag
uses: docker/build-push-action@v4
uses: docker/build-push-action@v5
with:
push: true
tags: ${{ env.IMAGE_REPOSITORY }}:${{ env.MINOR_TAG }}
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ FROM node:18-alpine
ENV NODE_OPTIONS="--max-old-space-size=8192 --openssl-legacy-provider --no-experimental-fetch"

# Install build dependancies.
RUN apk --no-cache --update add g++ make git python3 \
RUN apk --no-cache --update add g++ make git python3 py3-pip py3-setuptools \
&& rm -rf /var/cache/apk/*

RUN npm install -g [email protected]
Expand Down
2 changes: 1 addition & 1 deletion client/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@coralproject/talk",
"version": "9.0.6",
"version": "9.0.7",
"author": "The Coral Project",
"homepage": "https://coralproject.net/",
"sideEffects": [
Expand Down
2 changes: 1 addition & 1 deletion common/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "common",
"version": "9.0.6",
"version": "9.0.7",
"description": "",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion config/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "common",
"version": "9.0.6",
"version": "9.0.7",
"description": "",
"main": "dist/index.js",
"types": "dist/index.d.ts",
Expand Down
2 changes: 1 addition & 1 deletion server/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@coralproject/talk",
"version": "9.0.6",
"version": "9.0.7",
"author": "The Coral Project",
"homepage": "https://coralproject.net/",
"sideEffects": [
Expand Down
18 changes: 17 additions & 1 deletion server/src/core/server/graph/mutators/Actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {
GQLReviewCommentFlagInput,
} from "../schema/__generated__/types";

import { CommentNotFoundError, StoryNotFoundError } from "coral-server/errors";
import { validateUserModerationScopes } from "./helpers";

export const Actions = (ctx: GraphContext) => ({
Expand All @@ -34,6 +35,17 @@ export const Actions = (ctx: GraphContext) => ({
rejectComment: async (input: GQLRejectCommentInput) => {
// Validate that this user is allowed to moderate this comment
await validateUserModerationScopes(ctx, ctx.user!, input);

const comment = await ctx.loaders.Comments.comment.load(input.commentID);
if (!comment) {
throw new CommentNotFoundError(input.commentID);
}

const story = await ctx.loaders.Stories.find.load({ id: comment.storyID });
if (!story) {
throw new StoryNotFoundError(comment.storyID);
}

return rejectComment(
ctx.mongo,
ctx.redis,
Expand All @@ -47,7 +59,11 @@ export const Actions = (ctx: GraphContext) => ({
input.commentRevisionID,
ctx.user!.id,
ctx.now,
input.reason
input.reason,
undefined,
ctx.req,
true,
story.isArchived || story.isArchiving
);
},
reviewCommentFlag: async (input: GQLReviewCommentFlagInput) => {
Expand Down

0 comments on commit 9b5d878

Please sign in to comment.