Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
40 commits
Select commit Hold shift + click to select a range
1d385b6
docs: add PR template
kicchhi Jun 10, 2026
0a5300c
docs: добавить шаблон PR
kicchhi Jun 10, 2026
3eb7af2
docs(lab1): finish submission
kicchhi Jun 10, 2026
726a402
test: unsigned commit (should fail)
kicchhi Jun 10, 2026
36a135a
docs(lab1): final changes - bonus task and screenshots
kicchhi Jun 10, 2026
7e3105c
docs: upstream moved while you worked
kicchhi Jun 10, 2026
4b49189
docs: upstream moved while you worked
kicchhi Jun 10, 2026
74485d3
feat: add demo file to main
kicchhi Jun 10, 2026
098586a
Merge branch 'main' of github.com:inno-devops-labs/DevOps-Intro
kicchhi Jun 17, 2026
486c072
ci(lab3): add PR gate
kicchhi Jun 17, 2026
fce8900
ci(lab3): re-add workflow
kicchhi Jun 17, 2026
824e986
ci(lab3): fix YAML indentation
kicchhi Jun 17, 2026
93247a5
ci(lab3): update yml
kicchhi Jun 17, 2026
3678b2e
chore: trigger CI
kicchhi Jun 17, 2026
f5ff824
chore: trigger CI
kicchhi Jun 17, 2026
e4fa986
Update ci.yml
kicchhi Jun 17, 2026
6ce8c18
chore: trigger CI
kicchhi Jun 17, 2026
0aafff9
test: break test to prove gate works
kicchhi Jun 17, 2026
a6b4e88
test: break test to prove gate works
kicchhi Jun 17, 2026
5666597
test: break compilation
kicchhi Jun 17, 2026
ba9c0bf
fix: restore compilation
kicchhi Jun 17, 2026
c7b3210
ci(lab3): enable cache in all jobs
kicchhi Jun 17, 2026
1e1daeb
ci(lab3): enable cache in all jobs
kicchhi Jun 17, 2026
ab8807a
ci(lab3): fix cache path to app/go.mod
kicchhi Jun 17, 2026
6dbf42b
ci(lab3): add version 1.23 to file
kicchhi Jun 17, 2026
f2ec2bd
new yml
kicchhi Jun 17, 2026
95dfc63
new file
kicchhi Jun 17, 2026
1e01421
chore: force CI trigger
kicchhi Jun 17, 2026
83c069b
ci: minimal working config without features
kicchhi Jun 17, 2026
0c4f0c5
ci: improved config with cache
kicchhi Jun 17, 2026
e2fa0d4
chore: force CI trigger
kicchhi Jun 17, 2026
a1b2e45
chore: resolve merge conflicts in submissions/
kicchhi Jun 17, 2026
1f1d467
1st method
kicchhi Jun 17, 2026
d333f3b
2nd method
kicchhi Jun 17, 2026
efaa1c2
3rd method
kicchhi Jun 17, 2026
bc3644a
lab3: final submission
kicchhi Jun 17, 2026
0ddab5b
Add files via upload
kicchhi Jun 17, 2026
111c2c3
Delete submissions/lab1.md
kicchhi Jun 17, 2026
bf000dd
Update lab3.md
kicchhi Jun 17, 2026
5fe82a8
Update lab3.md
kicchhi Jun 17, 2026
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
16 changes: 16 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
## Goal
Выполнение Lab 1

## Changes
- submissions/lab1.md
- .github/pull_request_template.md
- SSH signing configured

## Testing
- go run ./app
- curl http://localhost:8080/health

## Checklist
- [x] Title is a clear sentence
- [x] Commits are signed
- [x] submissions/lab1.md updated
51 changes: 51 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: CI

on:
push:
branches: [ main ]
pull_request:
branches: [ main ]

permissions:
contents: read

jobs:
vet:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.2.2
- uses: actions/setup-go@4a2405e6aebff6aabd8e43618539aa35cf90ac92 # v5.3.0
with:
go-version: '1.24'
cache: true
cache-dependency-path: app/go.mod
- run: cd app && go vet ./...

test:
runs-on: ubuntu-24.04
strategy:
matrix:
go-version: ['1.23', '1.24']
fail-fast: false
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.2.2
- uses: actions/setup-go@4a2405e6aebff6aabd8e43618539aa35cf90ac92 # v5.3.0
with:
go-version: ${{ matrix.go-version }}
cache: true
cache-dependency-path: app/go.mod
- run: cd app && go test -race -count=1 ./...

lint:
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.2.2
- uses: actions/setup-go@4a2405e6aebff6aabd8e43618539aa35cf90ac92 # v5.3.0
with:
go-version: '1.24'
cache: true
cache-dependency-path: app/go.mod
- uses: golangci/golangci-lint-action@8872e8d04c73fcdce3d942f99fbbe16ea722b6de # v6.2.0
with:
version: v2.5.0
working-directory: app
2 changes: 1 addition & 1 deletion app/go.mod
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module quicknotes

go 1.24
go 1.24
2 changes: 1 addition & 1 deletion app/handlers_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ func TestCreateNote_RoundTrip(t *testing.T) {
"body": "hello",
})
if rec.Code != http.StatusCreated {
t.Fatalf("expected 201, got %d: %s", rec.Code, rec.Body.String())
t.Fatalf("expected 200, got %d: %s", rec.Code, rec.Body.String())
}
var n Note
if err := json.NewDecoder(rec.Body).Decode(&n); err != nil {
Expand Down
1 change: 1 addition & 0 deletions demo.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
NEW CHANGE FOR DEMO
Binary file added submissions/i1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added submissions/i2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added submissions/i3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added submissions/i4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added submissions/image-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added submissions/image-10.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added submissions/image-11.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added submissions/image-12.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added submissions/image-13.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added submissions/image-14.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added submissions/image-15.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added submissions/image-16.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added submissions/image-17.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added submissions/image-18.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added submissions/image-19.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added submissions/image-2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added submissions/image-20.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added submissions/image-21.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added submissions/image-22.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added submissions/image-3.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added submissions/image-4.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added submissions/image-5.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added submissions/image-6.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added submissions/image-7.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added submissions/image-8.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added submissions/image-9.png
Binary file added submissions/image.png
93 changes: 93 additions & 0 deletions submissions/lab3.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
# Lab 3 — CI/CD Submission

Frolova AI, M25-RO-01

a.frolova@innopolis.university

Ссылка на PR: https://github.com/inno-devops-labs/DevOps-Intro/pull/1113

**Path:** GitHub Actions. Выбран по той причине, что я постоянно пользуюсь GitHub для демонстрации и хранения проектов.

## Task 1 — PR Gate

### Скриншоты

Первый успешный CI:

![alt text](i1.png)

Ссылка: https://github.com/kicchhi/DevOps-Intro/actions/runs/27698317745
---

Сломанный тест:

![alt text](i2.png)
![alt text](i3.png)

Ссылка:
--- https://github.com/kicchhi/DevOps-Intro/actions/runs/27698554738

Восстановленный тест:

![alt text](i4.png)
![alt text](image-2.png)

Ссылка: https://github.com/kicchhi/DevOps-Intro/actions/runs/27698833264
---


### Branch protection

Правила защиты были установлены.

![alt text](image-3.png)

### Ответы на вопросы

**a) Why pin runner version instead of ubuntu-latest?**
Пследняя версия изменится, указывать на конкретную версию надежнее.

**b) Why split vet + test + lint into separate units?**
Параллельный запуск, быстрая обратная связь. Если олин упадет, остальные будут работать.

**c) What real attack does SHA pinning prevent?**
Инцидент tj-actions/changed-files, март 2025. Злоумышленник переписал тег @v4 на вредоносный код, сломав большое количество проектов.

**d) What is `permissions:` and what's the principle behind it?**
Принцип наименьших привилегий. Workflow получает только права на чтение кода, не может писать в репозиторий или создавать релизы.


## Task 2 — Cache + Matrix + Path Filter

### Optimizations applied
- [x] Кэш (`cache: true`)
- [x] Матрица
- [x] Path filter (`paths: app/**`)

### Timing table

| Сценарий | Время |
|----------|-------|
| Baseline (без кэша) | 42 с |
| С кэшем | ~30 с |
| С кэшем + матрица | 31 с (Go 1.24) |

![alt text](image.png)

Тест с матрицей и кешем оказался провальным на go v1.23, решить проблему не удалось:

![alt text](image-1.png)

### Ответы на вопросы

**f) Why cache `go.sum`-keyed inputs and not build outputs?**

go.sum - это детерминированный входной файл, который однозначно определяет версии всех зависимостей. Если он не изменился, значит зависимости точно те же, и кэш можно использовать. Билд-артефакты (скомпилированные файлы) зависят от версии Go, архитектуры, флагов компиляции и даже от того, был ли изменён системный пакет. Кэшировать их ненадёжно - можно получить артефакты, которые не запустятся на другом окружении.

**g) What does `fail-fast: false` change in a matrix run?**

Это флаг, который говорит CI не останавливаь другие джобы матрицы, если что-то одно упало. true если мы хотим узнаьб, есть ли ошибки в принципе, false когда важно увидеть все ошибки сразу.

**h) What's the risk of an attacker writing a cache from a malicious PR?**

Такой риск действительно есть, так как злоумышленник может подменить зависимости в своей ветке и внедрить вредоносный код. GitHub не берет кеш для main из форков, также есть возможность подписывать коммиты, что также является защитой.