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

Minor fixes 1 #51

Merged
merged 25 commits into from
Aug 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
5f60f2e
adiciona arquivos de migração de todos os apps
rafaelpezzuto Aug 30, 2024
d29f61a
adiciona configuração de uso do Solr em ambiente de produção
rafaelpezzuto Aug 30, 2024
072f1da
Corrige bug que impedia listagem de Top100ArtilceMetricsFiles
rafaelpezzuto Aug 30, 2024
1659aa4
Renomeia tasks
rafaelpezzuto Aug 30, 2024
3d73ec7
Corrige modo de criar ou atualizar dados top100 article metrics
rafaelpezzuto Aug 30, 2024
436e397
adiciona choice ERROR em Top100ArticleMetricsFile
rafaelpezzuto Aug 30, 2024
7464e9a
Renomeia tasks e remove campo update
rafaelpezzuto Aug 30, 2024
9418eba
Contabiliza linhas criadas e anota elementos a fazer
rafaelpezzuto Aug 30, 2024
e77c2a1
Adiciona exceção para lidar com attachment removido
rafaelpezzuto Aug 30, 2024
95ce994
remove form inutilizado
rafaelpezzuto Aug 30, 2024
33ad050
remove import desnecessário
rafaelpezzuto Aug 30, 2024
0dfe253
atualiza versao para 1.1.0
rafaelpezzuto Aug 30, 2024
d131a67
substitui docker-compose por docker compose
rafaelpezzuto Aug 30, 2024
9a71794
adiciona migração em modelo top100articlesfile
rafaelpezzuto Aug 30, 2024
de27a6f
substitui docker-compose por docker compose em ci
rafaelpezzuto Aug 30, 2024
bd13da4
substitui docker-compose por docker compose em ci
rafaelpezzuto Aug 30, 2024
09d7d29
Cria modelo para rastrear eventos de proc de Top100ArticlesFile
rafaelpezzuto Aug 30, 2024
73ea075
Atualiza tasks para utilizar tracker de eventos
rafaelpezzuto Aug 30, 2024
9ba6221
Cria arquivo de migração para Top100ArticlesFileEvent
rafaelpezzuto Aug 30, 2024
4c4a609
separa lógica de processamento em si para um método próprio
rafaelpezzuto Aug 30, 2024
d0125a6
melhora forma de criar/atualizar evento de proc de article metrics file
rafaelpezzuto Aug 30, 2024
dc35b15
remove filename from str
rafaelpezzuto Aug 30, 2024
4a905fe
fix migration files
rafaelpezzuto Aug 30, 2024
5a2389c
melhora método para detectar extensão de arquivo
rafaelpezzuto Aug 30, 2024
ce714f0
altera nome plural de events tracker
rafaelpezzuto Aug 30, 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
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,16 +28,16 @@ jobs:
uses: actions/checkout@v3

- name: Build the Stack
run: docker-compose -f local.yml build
run: docker compose -f local.yml build

- name: Make the migrations
run: docker compose -f local.yml run --rm django python manage.py makemigrations

- name: Run DB Migrations
run: docker-compose -f local.yml run --rm django python manage.py migrate
run: docker compose -f local.yml run --rm django python manage.py migrate

- name: Run Django Tests
run: docker-compose -f local.yml run django pytest
run: docker compose -f local.yml run django pytest

- name: Tear down the Stack
run: docker-compose -f local.yml down
run: docker compose -f local.yml down
46 changes: 23 additions & 23 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -32,71 +32,71 @@ build_date: ## Show build date
@echo "Build date: " $(SCMS_BUILD_DATE)

############################################
## atalhos docker-compose desenvolvimento ##
## atalhos docker compose desenvolvimento ##
############################################

build: ## Build app using $(compose)
@docker-compose -f $(compose) build
@docker compose -f $(compose) build

build_no_cache: ## Build app using $(compose)
@docker-compose -f $(compose) build --no-cache
@docker compose -f $(compose) build --no-cache

up: ## Start app using $(compose)
@docker-compose -f $(compose) up -d
@docker compose -f $(compose) up -d

logs: ## See all app logs using $(compose)
@docker-compose -f $(compose) logs -f
@docker compose -f $(compose) logs -f

stop: ## Stop all app using $(compose)
@docker-compose -f $(compose) stop
@docker compose -f $(compose) stop

restart:
@docker-compose -f $(compose) restart
@docker compose -f $(compose) restart

ps: ## See all containers using $(compose)
@docker-compose -f $(compose) ps
@docker compose -f $(compose) ps

rm: ## Remove all containers using $(compose)
@docker-compose -f $(compose) rm -f
@docker compose -f $(compose) rm -f

django_shell: ## Open python terminal from django $(compose)
@docker-compose -f $(compose) run --rm django python manage.py shell
@docker compose -f $(compose) run --rm django python manage.py shell

wagtail_sync: ## Wagtail sync Page fields (repeat every time you add a new language and to update the wagtailcore_page translations) $(compose)
@docker-compose -f $(compose) run --rm django python manage.py sync_page_translation_fields
@docker compose -f $(compose) run --rm django python manage.py sync_page_translation_fields

wagtail_update_translation_field: ## Wagtail update translation fields, user this command first $(compose)
@docker-compose -f $(compose) run --rm django python manage.py update_translation_fields
@docker compose -f $(compose) run --rm django python manage.py update_translation_fields

django_createsuperuser: ## Create a super user from django $(compose)
@docker-compose -f $(compose) run --rm django python manage.py createsuperuser
@docker compose -f $(compose) run --rm django python manage.py createsuperuser

django_bash: ## Open a bash terminar from django container using $(compose)
@docker-compose -f $(compose) run --rm django bash
@docker compose -f $(compose) run --rm django bash

django_test: ## Run tests from django container using $(compose)
@docker-compose -f $(compose) run --rm django python manage.py test
@docker compose -f $(compose) run --rm django python manage.py test

django_fast: ## Run tests fast from django container using $(compose)
@docker-compose -f $(compose) run --rm django python manage.py test --failfast
@docker compose -f $(compose) run --rm django python manage.py test --failfast

django_makemigrations: ## Run makemigrations from django container using $(compose)
@docker-compose -f $(compose) run --rm django python manage.py makemigrations
@docker compose -f $(compose) run --rm django python manage.py makemigrations

django_migrate: ## Run migrate from django container using $(compose)
@docker-compose -f $(compose) run --rm django python manage.py migrate
@docker compose -f $(compose) run --rm django python manage.py migrate

django_makemessages: ## Run ./manage.py makemessages $(compose)
@docker-compose -f $(compose) run --rm django python manage.py makemessages --all
@docker compose -f $(compose) run --rm django python manage.py makemessages --all

django_compilemessages: ## Run ./manage.py compilemessages $(compose)
@docker-compose -f $(compose) run --rm django python manage.py compilemessages
@docker compose -f $(compose) run --rm django python manage.py compilemessages

django_dump_auth: ## Run manage.py dumpdata auth --indent=2 $(compose)
@docker-compose -f $(compose) run --rm django python manage.py dumpdata auth --indent=2 --output=fixtures/auth.json
@docker compose -f $(compose) run --rm django python manage.py dumpdata auth --indent=2 --output=fixtures/auth.json

django_load_auth: ## Run manage.py dumpdata auth --indent=2 $(compose)
@docker-compose -f $(compose) run --rm django python manage.py loaddata --database=default fixtures/auth.json
@docker compose -f $(compose) run --rm django python manage.py loaddata --database=default fixtures/auth.json

dump_data: ## Dump database into .sql $(compose)
docker exec -t scielo_core_local_postgres pg_dumpall -c -U debug > dump_`date +%d-%m-%Y"_"%H_%M_%S`.sql
Expand All @@ -121,7 +121,7 @@ clean_project_images: ## Remove all images with "core" on name
@docker rmi -f $$(docker images --filter=reference='*scielo_core*' -q)

volume_down: ## Remove all volume
@docker-compose -f $(compose) down -v
@docker compose -f $(compose) down -v

clean_migrations: ## Remove all migrations
@echo "Cleaning migrations..."
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.0.0
1.1.0
223 changes: 223 additions & 0 deletions collection/migrations/0001_initial.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,223 @@
# Generated by Django 5.0.7 on 2024-08-30 00:52

import django.db.models.deletion
import modelcluster.fields
from django.conf import settings
from django.db import migrations, models


class Migration(migrations.Migration):
initial = True

dependencies = [
("core", "0001_initial"),
migrations.swappable_dependency(settings.AUTH_USER_MODEL),
]

operations = [
migrations.CreateModel(
name="Collection",
fields=[
(
"id",
models.BigAutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
(
"created",
models.DateTimeField(
auto_now_add=True, verbose_name="Creation date"
),
),
(
"updated",
models.DateTimeField(
auto_now=True, verbose_name="Last update date"
),
),
(
"acron3",
models.CharField(
blank=True,
max_length=10,
null=True,
verbose_name="Acronym with 3 chars",
),
),
(
"acron2",
models.CharField(
blank=True,
max_length=10,
null=True,
verbose_name="Acronym with 2 chars",
),
),
(
"code",
models.CharField(
blank=True, max_length=10, null=True, verbose_name="Código"
),
),
(
"domain",
models.URLField(blank=True, null=True, verbose_name="Domain"),
),
(
"main_name",
models.TextField(blank=True, null=True, verbose_name="Main name"),
),
(
"status",
models.CharField(
blank=True,
choices=[
("certified", "Certified"),
("development", "Development"),
("diffusion", "Diffusion"),
("independent", "Independent"),
],
max_length=20,
null=True,
verbose_name="Status",
),
),
(
"has_analytics",
models.BooleanField(
blank=True, null=True, verbose_name="Has analytics"
),
),
(
"collection_type",
models.CharField(
blank=True,
choices=[
("journals", "Journals"),
("preprints", "Preprints"),
("repositories", "Repositories"),
("books", "Books"),
("data", "Data repository"),
],
max_length=20,
null=True,
verbose_name="Collection Type",
),
),
(
"is_active",
models.BooleanField(
blank=True, null=True, verbose_name="Is active"
),
),
(
"foundation_date",
models.DateField(
blank=True, null=True, verbose_name="Foundation data"
),
),
(
"creator",
models.ForeignKey(
editable=False,
null=True,
on_delete=django.db.models.deletion.SET_NULL,
related_name="%(class)s_creator",
to=settings.AUTH_USER_MODEL,
verbose_name="Creator",
),
),
(
"updated_by",
models.ForeignKey(
blank=True,
editable=False,
null=True,
on_delete=django.db.models.deletion.SET_NULL,
related_name="%(class)s_last_mod_user",
to=settings.AUTH_USER_MODEL,
verbose_name="Updater",
),
),
],
options={
"verbose_name": "Coleção",
"verbose_name_plural": "Coleções",
"ordering": ["main_name"],
},
),
migrations.CreateModel(
name="CollectionName",
fields=[
(
"id",
models.BigAutoField(
auto_created=True,
primary_key=True,
serialize=False,
verbose_name="ID",
),
),
("text", models.TextField(blank=True, null=True, verbose_name="Texto")),
(
"collection",
modelcluster.fields.ParentalKey(
blank=True,
null=True,
on_delete=django.db.models.deletion.SET_NULL,
related_name="collection_name",
to="collection.collection",
),
),
(
"language",
models.ForeignKey(
blank=True,
null=True,
on_delete=django.db.models.deletion.SET_NULL,
to="core.language",
verbose_name="Idioma",
),
),
],
options={
"abstract": False,
},
),
migrations.AddIndex(
model_name="collection",
index=models.Index(fields=["acron3"], name="collection__acron3_a9f5cf_idx"),
),
migrations.AddIndex(
model_name="collection",
index=models.Index(fields=["acron2"], name="collection__acron2_a6ae4c_idx"),
),
migrations.AddIndex(
model_name="collection",
index=models.Index(fields=["code"], name="collection__code_e4f01a_idx"),
),
migrations.AddIndex(
model_name="collection",
index=models.Index(fields=["domain"], name="collection__domain_f79fa7_idx"),
),
migrations.AddIndex(
model_name="collection",
index=models.Index(
fields=["main_name"], name="collection__main_na_f316bd_idx"
),
),
migrations.AddIndex(
model_name="collection",
index=models.Index(fields=["status"], name="collection__status_ee0d16_idx"),
),
migrations.AddIndex(
model_name="collection",
index=models.Index(
fields=["collection_type"], name="collection__collect_a99863_idx"
),
),
]
2 changes: 1 addition & 1 deletion compose/production/postgres/maintenance/backup
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
### Create a database backup.
###
### Usage:
### $ docker-compose -f <environment>.yml (exec |run --rm) postgres backup
### $ docker compose -f <environment>.yml (exec |run --rm) postgres backup


set -o errexit
Expand Down
2 changes: 1 addition & 1 deletion compose/production/postgres/maintenance/backups
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
### View backups.
###
### Usage:
### $ docker-compose -f <environment>.yml (exec |run --rm) postgres backups
### $ docker compose -f <environment>.yml (exec |run --rm) postgres backups


set -o errexit
Expand Down
2 changes: 1 addition & 1 deletion compose/production/postgres/maintenance/restore
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
### <1> filename of an existing backup.
###
### Usage:
### $ docker-compose -f <environment>.yml (exec |run --rm) postgres restore <1>
### $ docker compose -f <environment>.yml (exec |run --rm) postgres restore <1>


set -o errexit
Expand Down
4 changes: 4 additions & 0 deletions config/settings/production.py
Original file line number Diff line number Diff line change
Expand Up @@ -201,3 +201,7 @@

# Your stuff...
# ------------------------------------------------------------------------------
USE_SOLR = env.bool("USE_SOLR", default=True)

if USE_SOLR:
HAYSTACK_SIGNAL_PROCESSOR = "haystack.signals.RealtimeSignalProcessor"
Loading
Loading