Skip to content

Commit

Permalink
Merge branch 'v2' into feat/add_limit_offset_to_requests_parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
reiroop authored Dec 28, 2024
2 parents 784b869 + c3dbb3b commit 6e26ec7
Show file tree
Hide file tree
Showing 38 changed files with 901 additions and 290 deletions.
7 changes: 7 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
MARIADB_HOSTNAME=localhost
MARIADB_USERNAME=root
MARIADB_PASSWORD=password
MARIADB_DATABASE=jomon
MARIADB_PORT=3306
IS_DEBUG_MODE=true
UPLOAD_DIR=./uploads
95 changes: 95 additions & 0 deletions .github/workflows/codeql.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,95 @@
# For most projects, this workflow file will not need changing; you simply need
# to commit it to your repository.
#
# You may wish to alter this file to override the set of languages analyzed,
# or to provide custom queries or build logic.
#
# ******** NOTE ********
# We have attempted to detect the languages in your repository. Please check
# the `language` matrix defined below to confirm you have the correct set of
# supported CodeQL languages.
#
name: "CodeQL"

on:
push:
branches:
- v2
pull_request:
branches:
- v2
schedule:
- cron: '0 0 1 * *'
workflow_dispatch:

jobs:
analyze:
name: Analyze (${{ matrix.language }})
# Runner size impacts CodeQL analysis time. To learn more, please see:
# - https://gh.io/recommended-hardware-resources-for-running-codeql
# - https://gh.io/supported-runners-and-hardware-resources
# - https://gh.io/using-larger-runners (GitHub.com only)
# Consider using larger runners or machines with greater resources for possible analysis time improvements.
runs-on: ${{ (matrix.language == 'swift' && 'macos-latest') || 'ubuntu-latest' }}
permissions:
# required for all workflows
security-events: write

# required to fetch internal or private CodeQL packs
packages: read

# only required for workflows in private repositories
actions: read
contents: read

strategy:
fail-fast: false
matrix:
include:
- language: go
build-mode: autobuild
# CodeQL supports the following values keywords for 'language': 'c-cpp', 'csharp', 'go', 'java-kotlin', 'javascript-typescript', 'python', 'ruby', 'swift'
# Use `c-cpp` to analyze code written in C, C++ or both
# Use 'java-kotlin' to analyze code written in Java, Kotlin or both
# Use 'javascript-typescript' to analyze code written in JavaScript, TypeScript or both
# To learn more about changing the languages that are analyzed or customizing the build mode for your analysis,
# see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/customizing-your-advanced-setup-for-code-scanning.
# If you are analyzing a compiled language, you can modify the 'build-mode' for that language to customize how
# your codebase is analyzed, see https://docs.github.com/en/code-security/code-scanning/creating-an-advanced-setup-for-code-scanning/codeql-code-scanning-for-compiled-languages
steps:
- name: Checkout repository
uses: actions/checkout@v4

# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
build-mode: ${{ matrix.build-mode }}
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.

# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality

# If the analyze step fails for one of the languages you are analyzing with
# "We were unable to automatically build your code", modify the matrix above
# to set the build mode to "manual" for that language. Then modify this step
# to build your code.
# ℹ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
- if: matrix.build-mode == 'manual'
shell: bash
run: |
echo 'If you are using a "manual" build mode for one or more of the' \
'languages you are analyzing, replace this with the commands to build' \
'your code, for example:'
echo ' make bootstrap'
echo ' make release'
exit 1
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{matrix.language}}"
2 changes: 1 addition & 1 deletion .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ jobs:
MARIADB_PORT: 50000

- name: Upload coverage to Codecov
uses: codecov/codecov-action@v4
uses: codecov/codecov-action@v5
with:
files: ./coverage.out
token: ${{ secrets.CODECOV_TOKEN }}
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
## build backend
FROM golang:1.23.2-alpine as server-build
FROM golang:1.23.3-alpine as server-build

WORKDIR /github.com/traPtitech/Jomon
COPY go.mod go.sum ./
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.dev
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.23.2-alpine as build
FROM golang:1.23.3-alpine as build
ENV CGO_ENABLED 0
ENV TZ Asia/Tokyo

Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ make down

## Staging

1. Set .env file.
1. Set `.env` file. You can refer to `.env.example` as an example.

- `IS_DEBUG_MODE`: Set `true` if you want to run the server in debug mode, otherwise do not set this variable.
- `PORT`: Port number for Jomon staging server
Expand Down
9 changes: 9 additions & 0 deletions docs/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -153,6 +153,7 @@ paths:
- $ref: "#/components/parameters/offsetQuery"
- $ref: "#/components/parameters/tagQuery"
- $ref: "#/components/parameters/groupQuery"
- $ref: "#/components/parameters/createdByQuery"
responses:
"200":
description: 取得できた場合。該当するものがなくても空配列を返す。
Expand Down Expand Up @@ -1457,6 +1458,14 @@ components:
in: query
schema:
type: string
createdByQuery:
name: created_by
description: 作成者
required: false
in: query
schema:
type: string
format: uuid
requestQuery:
name: request
description: 依頼
Expand Down
3 changes: 2 additions & 1 deletion ent/migrate/schema.go

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

56 changes: 55 additions & 1 deletion ent/mutation.go

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

27 changes: 23 additions & 4 deletions ent/runtime.go

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

4 changes: 2 additions & 2 deletions ent/runtime/runtime.go

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

8 changes: 8 additions & 0 deletions ent/schema/transactiondetail.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
package schema

import (
"errors"
"strings"
"time"

"entgo.io/ent"
Expand All @@ -19,6 +21,12 @@ func (TransactionDetail) Fields() []ent.Field {
return []ent.Field{
field.UUID("id", uuid.UUID{}).
Default(uuid.New),
field.String("title").NotEmpty().MaxLen(64).Validate(func(s string) error {
if strings.Contains(s, "\n") {
return errors.New("title cannot contain new line")
}
return nil
}),
field.Int("amount").
Default(0),
field.String("target").
Expand Down
13 changes: 12 additions & 1 deletion ent/transactiondetail.go

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

Loading

0 comments on commit 6e26ec7

Please sign in to comment.