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

Work on the project has been completed #2

Open
wants to merge 26 commits into
base: release
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 22 commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
051cb01
Initial commit
MlDenis Dec 29, 2023
38d84c4
Add project migrations.
MlDenis Dec 29, 2023
d116dcd
Add project models.
MlDenis Dec 29, 2023
0c430f1
Add db queries.
MlDenis Dec 29, 2023
233265c
Add logger preset.
MlDenis Dec 29, 2023
f3a34f4
Add errors preset.
MlDenis Dec 29, 2023
be5c57b
Go mod init.
MlDenis Dec 29, 2023
378ceb7
Adding missing imports.
MlDenis Dec 29, 2023
c6bf240
Fixed import order and added missing error handling.
MlDenis Dec 29, 2023
2a16f30
Delete useless error handling in test files.
MlDenis Dec 29, 2023
4428791
Empty messagem into a topic branch.
MlDenis Jan 9, 2024
0aa1ddf
Constants have been moved to a separate configuration file.
MlDenis Jan 10, 2024
da20c67
Changed the standard logger to zap. Abandoned the practice of using a…
MlDenis Jan 11, 2024
46ca73c
Fix logger bugs.
MlDenis Jan 11, 2024
6f4efba
Added graceful shutdown.
MlDenis Jan 11, 2024
2030e3a
Modify ManageJobs func. Add goroutine and defer wg.Done().
MlDenis Jan 11, 2024
7f505ff
Fix empty return actions.
MlDenis Jan 11, 2024
5742109
Fix unhandled goroutine case when programm off: go a.manager.ManageJo…
MlDenis Jan 11, 2024
c68cb7e
Added registration token encryption.
MlDenis Jan 11, 2024
ddbd42e
Fix logger implementation and other small fix.
MlDenis Jan 11, 2024
0257e84
Removed useless error objects.
MlDenis Jan 12, 2024
2808a1b
Removed registration token encryption.
MlDenis Jan 12, 2024
4290315
Fix incorrect logger implementation. Added context.WithCancel for mai…
MlDenis Jan 16, 2024
cf14737
Fix program shutdown.
MlDenis Jan 16, 2024
e8f8871
Fix logger implementation.
MlDenis Jan 16, 2024
5a53137
Another fix logger implementation.
MlDenis Jan 16, 2024
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
64 changes: 64 additions & 0 deletions .github/workflows/gophermart.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: gophermart

on:
workflow_dispatch:
pull_request:
push:
branches:
- main
- master

jobs:

build:
runs-on: ubuntu-latest
container: golang:1.21

services:
postgres:
image: postgres
env:
POSTGRES_PASSWORD: postgres
POSTGRES_DB: praktikum
options: >-
--health-cmd pg_isready
--health-interval 5s
--health-timeout 5s
--health-retries 5

steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Download autotests binaries
uses: robinraju/[email protected]
with:
repository: Yandex-Practicum/go-autotests
latest: true
fileName: "*"
out-file-path: .tools
token: ${{ secrets.GITHUB_TOKEN }}

- name: Setup autotest binary
run: |
chmod -R +x $GITHUB_WORKSPACE/.tools
mv $GITHUB_WORKSPACE/.tools/gophermarttest /usr/local/bin/gophermarttest
mv $GITHUB_WORKSPACE/.tools/random /usr/local/bin/random

- name: Prepare binaries
run: |
(cd cmd/gophermart && go build -buildvcs=false -o gophermart)
(cd cmd/accrual && chmod +x accrual_linux_amd64)

- name: Test
run: |
gophermarttest \
-test.v -test.run=^TestGophermart$ \
-gophermart-binary-path=cmd/gophermart/gophermart \
-gophermart-host=localhost \
-gophermart-port=8080 \
-gophermart-database-uri="postgresql://postgres:postgres@postgres/praktikum?sslmode=disable" \
-accrual-binary-path=cmd/accrual/accrual_linux_amd64 \
-accrual-host=localhost \
-accrual-port=$(random unused-port) \
-accrual-database-uri="postgresql://postgres:postgres@postgres/praktikum?sslmode=disable"
34 changes: 34 additions & 0 deletions .github/workflows/statictest.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
name: go vet test

on:
pull_request:
push:
branches:
- master
- main

jobs:
statictest:
runs-on: ubuntu-latest
container: golang:1.21
steps:
- name: Checkout code
uses: actions/checkout@v2

- name: Download statictest binary
uses: robinraju/[email protected]
with:
repository: Yandex-Practicum/go-autotests
latest: true
fileName: statictest
out-file-path: .tools
token: ${{ secrets.GITHUB_TOKEN }}

- name: Setup autotest binary
run: |
chmod -R +x $GITHUB_WORKSPACE/.tools/statictest
mv $GITHUB_WORKSPACE/.tools/statictest /usr/local/bin/statictest

- name: Run statictest
run: |
go vet -vettool=$(which statictest) ./...
23 changes: 23 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# Binaries for programs and plugins
*.exe
*.exe~
*.dll
*.so
*.dylib

# Test binary, built with `go test -c`
*.test

# Output of the go coverage tool, specifically when used with LiteIDE
*.out

# Binaries
cmd/gophermart/main
cmd/gophermart/gophermart

# Dependency directories (remove the comment below to include it)
vendor/

# IDEs directories
.idea
.vscode
25 changes: 25 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# go-musthave-diploma-tpl

Шаблон репозитория для индивидуального дипломного проекта курса «Go-разработчик»

# Начало работы

1. Склонируйте репозиторий в любую подходящую директорию на вашем компьютере.
2. В корне репозитория выполните команду `go mod init <name>` (где `<name>` — адрес вашего репозитория на GitHub без
префикса `https://`) для создания модуля

# Обновление шаблона

Чтобы иметь возможность получать обновления автотестов и других частей шаблона, выполните команду:

```
git remote add -m master template https://github.com/yandex-praktikum/go-musthave-diploma-tpl.git
```

Для обновления кода автотестов выполните команду:

```
git fetch template && git checkout template/master .github
```

Затем добавьте полученные изменения в свой репозиторий.
Loading
Loading