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 1 #4

Merged
merged 44 commits into from
Nov 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
44 commits
Select commit Hold shift + click to select a range
2c68a31
Adiciona docker e arquivos iniciais do FastApi
joao15victor08 Oct 30, 2023
7c47834
adiciona configurações do database
Marcosatc147 Oct 31, 2023
5849188
adiciona model de comentario
Marcosatc147 Oct 31, 2023
1ed8e53
adiciona repositório de comentario
Marcosatc147 Oct 31, 2023
30e4ce7
adiciona domain e controller
Marcosatc147 Oct 31, 2023
cf10ffa
Correções para conectar Fast api ao postgres
joao15victor08 Oct 31, 2023
075180f
Adiciona .env ao docker compose
joao15victor08 Oct 31, 2023
adf92d5
Adiciona a porta a url de acesso ao banco
joao15victor08 Oct 31, 2023
a9429db
Adiciona schema de criar comentario
joao15victor08 Oct 31, 2023
e02bb52
Corrige metodo de busca comentarios por video_id
joao15victor08 Oct 31, 2023
2d8038c
Adiciona rota para criar comentario
joao15victor08 Oct 31, 2023
fcfb23a
Adiciona cors middleware e rota de comentarios
joao15victor08 Oct 31, 2023
ca673db
corrige funções de busca de video
Marcosatc147 Nov 1, 2023
6a40579
adiciona mensagens de erro e função delete
Marcosatc147 Nov 1, 2023
e43d8f7
adiciona função de atualizar comentário
Marcosatc147 Nov 1, 2023
b83665b
Adicionado web scraping do site da unb
nYCSTs Nov 13, 2023
5fb9a12
Adiciona nome de usuário
joao15victor08 Nov 14, 2023
edd05a6
Adiciona filtro na busca de grade e realiza alguns gerais
nYCSTs Nov 15, 2023
3497879
Padroniza docker files
joao15victor08 Nov 15, 2023
b6958f7
Adiciona arquivos para sonar
geraldovictor Nov 16, 2023
210a099
Adiciona arquivos para deploys
geraldovictor Nov 16, 2023
963e10b
Merge branch '49-comentarios-videos' of github.com:fga-eps-mds/2023.2…
joao15victor08 Nov 16, 2023
52f0fcf
Atualiza porta
geraldovictor Nov 16, 2023
fc91dff
Adiciona templates de pr, user stories,features request e bug_report
geraldovictor Nov 16, 2023
1cb9f32
Configura sonar
geraldovictor Nov 16, 2023
1283b53
Merge pull request #1 from fga-eps-mds/sonar-scripts
geraldovictor Nov 16, 2023
b0bf41b
Adiciona testes
nYCSTs Nov 16, 2023
6b177cf
Adiciona CORS e ajusta inicialização
nYCSTs Nov 16, 2023
c9daf6e
Adiciona testes da criação de comentários
nYCSTs Nov 16, 2023
4520632
Limpa __init__.py
nYCSTs Nov 16, 2023
e55e40f
Atualiza teste de criação de comentario
nYCSTs Nov 16, 2023
7487c50
Merge branch 'develop' into 49-comentarios-videos
joao15victor08 Nov 16, 2023
762fdca
Merge pull request #3 from fga-eps-mds/49-comentarios-videos
geraldovictor Nov 16, 2023
dee51c2
Fix deploy
joao15victor08 Nov 17, 2023
3ffca3f
Merge branch 'develop' of github.com:fga-eps-mds/2023.2-UnB-TV-VideoS…
nYCSTs Nov 20, 2023
012fa04
Adiciona controller de grade
nYCSTs Nov 20, 2023
10c5b80
Merge pull request #2 from fga-eps-mds/54-grade-programacao
joao15victor08 Nov 20, 2023
14a0325
Teste release
joao15victor08 Nov 22, 2023
a291aa8
Merge pull request #5 from fga-eps-mds/teste-release
joao15victor08 Nov 22, 2023
18c70fc
Resolve teste
joao15victor08 Nov 22, 2023
9e8da2b
Resolve teste
joao15victor08 Nov 22, 2023
084f76f
Merge branch 'develop' of github.com:fga-eps-mds/2023.2-UnB-TV-VideoS…
joao15victor08 Nov 22, 2023
8839f71
Corrige commit feito errado
joao15victor08 Nov 22, 2023
687fd4c
Merge pull request #6 from fga-eps-mds/hot-fix
joao15victor08 Nov 22, 2023
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
30 changes: 30 additions & 0 deletions .github/templates/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
---
name: Bug report
about: Coloque os detalhes do bug
title: "[BUG] nome da tarefa no verbo infinitivo"
labels: bug
assignees: ''

---

**Descrição do bug**
<!--Uma descrição clara e concisa do que é o bug.-->

**Para reproduzir o bug**
<!--Etapas para reproduzir o comportamento:
1. Vá para '...'
2. Clique em '....'
3. Role para baixo até '....'
4. Ver erro-->

**Comportamento esperado**
<!--Uma descrição clara e concisa do que você esperava que acontecesse.-->

**Tarefas**
<!--- [] Descrever a tarefa para a issue-->

**Screenshots**
<!--Se aplicável, adicione capturas de tela para ajudar a explicar seu problema.-->

**Adicional**
<!--Adicione qualquer outro contexto sobre o problema aqui.-->
21 changes: 21 additions & 0 deletions .github/templates/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
name: Feature request
about: Coloque os detalhes da issue
title: '[Doc] ou [Feature] e o nome da tarefa no verbo infinitivo'
labels: ''
assignees: ''

---

**Descreva sua issue**
<!--Uma descrição clara e concisa do que você quer que aconteça.-->

**Tarefas**
<!--- [] Descrever a tarefa para a issue -->

**Critérios de Aceitação**
<!--Seção para os critérios que definem acerca da aceitação da tarefa. -->
<!--- [ ] Descrever o critério de aceitação -->

**Contexto adicional**
<!--Adicione qualquer outro contexto ou captura de tela sobre a solicitação de recurso aqui. -->
26 changes: 26 additions & 0 deletions .github/templates/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
<!--- Forneça um resumo geral das suas alterações no título acima -->

## Descrição
<!--- Decreva suas alterações detalhadamente -->

## _Issue_ Relacionada
<!--- Este projeto apenas aceita _pull requests_ relacionadas à _issues_ abertas. -->
<!--- Se está sugerindo uma nova _feature_ ou mudança, por favor discuta em uma _issue_ antes. -->
<!--- Se está corrigindo um _bug_, deve haver uma _issue_ descrevendo-o com passos para reproduzir. -->
<!--- Por favor, adicione o link para a _issue_ aqui: -->
<!--- #nome_da_issue: -->


## Como Isso Foi Testado?
<!--- Por favor, descreva detalhadamente como você testou suas mudanças. -->
<!--- Inclua detalhes do seu ambiente de teste e os testes que você executou -->
<!--- para ver como a sua alteração afeta outras áreas do código, etc. -->

## Capturas de Tela (se apropriado):

## Tipos de Mudanças
<!--- Quais os tipos de alterações introduzidos pelo seu código? Coloque um `x` em todas as caixas que se aplicam: -->
- [ ] _Bug fix_ (alteração que corrige uma _issue_ e não altera funcionalidades já existentes);
- [ ] Nova _feature_ (alteração que adiciona uma funcionalidade e não altera funcionalidades já existentes);
- [ ] Alteração disruptiva (_Breaking change_) (Correção ou funcionalidade que causa alteração nas funcionalidades existentes);
- [ ] Documentação.
24 changes: 24 additions & 0 deletions .github/templates/user_stories.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
name: User Stories
about: Coloque os detalhes da US
title: 'USX'
labels: ux
assignees: ''

---

**Descrição da Issue**
<!-- Descreva de forma sucinta a issue e caso necessite, as informações adicionais necessárias para sua realização. -->

**Tarefas**
<!-- - [ ] Tarefa 1
- [ ] Tarefa 2
- [ ] Tarefa 3 -->

**Protótipo**
<!-- Adicionar link -->

**Critérios de Aceitação**
<!-- - [ ] Critério 1
- [ ] Critério 2
- [ ] Critério 3 -->
57 changes: 57 additions & 0 deletions .github/workflows/code-analysis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Análise de Código
on: push

jobs:
sonarcloud:
runs-on: ubuntu-latest

services:
postgres:
image: postgres:alpine
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_DB: postgres
ports:
- 5432:5432
options: --health-cmd pg_isready --health-interval 10s --health-timeout 5s --health-retries 5

steps:
- name: Check out repository code
uses: actions/checkout@v4

- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.11'

- name: Creating env file
run: |
echo "${{ vars.ENV_FILE }}" > .env

- name: Setup virtual environment
run: |
python -m venv venv
source venv/bin/activate

- name: Install dependencies
run: pip install -r requirements.txt

- name: Executa Pytest
run: PYTHONPATH=src python -m coverage run -m pytest --continue-on-collection-errors --junitxml=./junit.xml
env:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
POSTGRES_HOST: localhost
POSTGRES_DB: postgres
POSTGRES_PORT: 5432

- name: Gera arquivos de testes no formato .xml
run: python3 -m coverage xml

- name: Executa SonarCloud Scan
if: ${{ always() }}
uses: SonarSource/sonarcloud-github-action@master
env:
GITHUB_TOKEN: ${{ secrets.API_TOKEN_GITHUB }}
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
40 changes: 40 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: Release

on:
pull_request:
branches:
- main
- develop
types: [ closed ]

jobs:
release:
if: github.event.pull_request.merged == true && contains(github.event.pull_request.labels.*.name, 'NOT RELEASE') == false
runs-on: "ubuntu-latest"

steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Cria arquivo .env
run: |
touch ./scripts/.env
echo TOKEN=${{ secrets.API_TOKEN_GITHUB }} >> ./scripts/.env
echo RELEASE_MAJOR=${{ contains(github.event.pull_request.labels.*.name, 'MAJOR RELEASE') }} >> ./scripts/.env
echo RELEASE_MINOR=${{ contains(github.event.pull_request.labels.*.name, 'MINOR RELEASE') }} >> ./scripts/.env
echo RELEASE_FIX=${{ contains(github.event.pull_request.labels.*.name, 'FIX RELEASE') }} >> ./scripts/.env
echo DEVELOP=${{ contains(github.event.pull_request.labels.*.name, 'DEVELOP') }} >> ./scripts/.env

- name: Gera release e envia métricas para repositório de DOC
run: |
cd scripts && yarn install && node release.js
git config --global user.email "${{secrets.GIT_USER_EMAIL}}"
git config --global user.name "${{secrets.GIT_USER_NAME}}"
git clone --single-branch --branch main "https://x-access-token:${{secrets.API_TOKEN_GITHUB}}@github.com/fga-eps-mds/${{secrets.GIT_DOC_REPO}}" ${{secrets.GIT_DOC_REPO}}
mkdir -p ${{secrets.GIT_DOC_REPO}}/analytics-raw-data
cp -R analytics-raw-data/*.json ${{secrets.GIT_DOC_REPO}}/analytics-raw-data
cd ${{secrets.GIT_DOC_REPO}}
git add .
git commit -m "Adicionando métricas do repositório ${{ github.event.repository.name }} ${{ github.ref_name }}"
git push
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -158,3 +158,5 @@ cython_debug/
# and can be added to the global gitignore or merged into this file. For a more nuclear
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
#.idea/
.vscode/
.vs/
16 changes: 16 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
FROM python:3.10.9-slim-buster

WORKDIR /app

ENV PYTHONDONTWRITEBYTECODE 1
ENV PYTHONBUFFERED 1

COPY requirements.txt /app/requirements.txt

RUN pip3 install --no-cache-dir -r /app/requirements.txt

COPY . /app/

WORKDIR src

CMD [ "uvicorn", "main:app", "--host", "0.0.0.0", "--port", "8001", "--reload"]
1 change: 1 addition & 0 deletions Procfile
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
web: python src/main.py ${PORT}
49 changes: 49 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
services:
app:
build: .
ports:
- 8001:8001
volumes:
- .:/app/
env_file:
- ./.env
environment:
- POSTGRES_HOST=db
depends_on:
db:
condition: service_healthy
restart: always
networks:
- backend_videos

db:
image: postgres
volumes:
- postgres_data:/var/lib/postgresql/data/
expose:
- 5432
environment:
- POSTGRES_HOST=${POSTGRES_HOST}
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- POSTGRES_USER=${POSTGRES_USER}
- POSTGRES_DB=${POSTGRES_DB}
env_file:
- ./.env
restart: always
networks:
- backend_videos
healthcheck:
test:
[
"CMD-SHELL",
"pg_isready -d ${POSTGRES_DB} -U ${POSTGRES_USER}",
]
interval: 10s
timeout: 5s
retries: 5

volumes:
postgres_data:

networks:
backend_videos:
5 changes: 5 additions & 0 deletions env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
POSTGRES_USER=
POSTGRES_PASSWORD=
POSTGRES_HOST=
POSTGRES_DB=
POSTGRES_PORT=
78 changes: 78 additions & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
aiosmtplib==2.0.2
annotated-types==0.6.0
anyio==3.7.1
beautifulsoup4==4.12.2
bs4==0.0.1
astroid==3.0.1
bcrypt==4.0.1
blinker==1.6.3
certifi==2023.7.22
cffi==1.16.0
charset-normalizer==3.3.2
click==8.1.7
coverage==7.3.2
cryptography==41.0.4
DateTime==5.2
deprecation==2.1.0
dill==0.3.7
dnspython==2.4.2
docker==6.1.3
ecdsa==0.18.0
email-validator==2.0.0.post2
fastapi==0.104.0
fastapi-filter==1.0.0
fastapi-mail==1.4.1
fastapi-sso==0.7.2
greenlet==3.0.0
h11==0.14.0
httpcore==0.18.0
httptools==0.6.1
httpx==0.25.0
idna==3.4
iniconfig==2.0.0
isort==5.12.0
Jinja2==3.1.2
MarkupSafe==2.1.3
mccabe==0.7.0
oauthlib==3.2.2
packaging==23.2
passlib==1.7.4
platformdirs==3.11.0
pluggy==1.3.0
psycopg2-binary==2.9.9
pyasn1==0.5.0
pycparser==2.21
pydantic==2.4.2
pydantic-settings==2.0.3
pydantic_core==2.10.1
pylint==3.0.2
PyMySQL==1.1.0
pytest==7.4.2
pytest-asyncio==0.21.1
pytest-html==4.1.1
pytest-metadata==3.0.0
pytest-mock==3.12.0
python-dotenv==1.0.0
python-jose==3.3.0
python-multipart==0.0.6
pytz==2023.3.post1
PyYAML==6.0.1
requests==2.31.0
rsa==4.9
six==1.16.0
sniffio==1.3.0
soupsieve==2.5
SQLAlchemy==2.0.22
starlette==0.27.0
testcontainers==3.7.1
tomlkit==0.12.2
typing_extensions==4.8.0
ujson==5.8.0
Unidecode==1.3.7
urllib3==2.1.0
uvicorn==0.23.2
watchfiles==0.21.0
websocket-client==1.6.4
websockets==11.0.3
wrapt==1.15.0
zope.interface==6.1
1 change: 1 addition & 0 deletions runtime.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
python-3.10.12
Loading
Loading