From 3008570672675339942c372a2c8f60e31054690d Mon Sep 17 00:00:00 2001 From: rnhdev Date: Sun, 3 Nov 2024 17:05:28 -0300 Subject: [PATCH 01/14] Configuracion Sonar --- .github/workflows/test.yml | 47 +++++++++++++++++++++----------------- requirements.txt | 2 +- sonar-project.properties | 18 +++++++++++++++ 3 files changed, 45 insertions(+), 22 deletions(-) create mode 100644 sonar-project.properties diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index bf66c587..19ab3ca8 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -1,28 +1,33 @@ -name: CI - -# Controls when the action will run. +name: Build on: push: - branches: [ main ] + branches: + - main pull_request: - branches: [ main ] - -# A workflow run is made up of one or more jobs that can run sequentially or in parallel + types: [opened, synchronize, reopened] jobs: - job1: - name: Pruebas + sonarcloud: + environment: prod + name: SonarCloud runs-on: ubuntu-latest steps: - - name: Checkout de repositorio - uses: actions/checkout@v2 - - name: Configuración de entorno de python - uses: actions/setup-python@v2 - with: + - uses: actions/checkout@v2 + with: + fetch-depth: 0 + - name: Setup Python + uses: actions/setup-python@v4 + with: python-version: '3.7' - - name: Instalación de librerías y dependencias - run: | - python -m pip install --upgrade pip - pip install -r requirements.txt - - name: Correr pruebas - id: correr-pruebas - run: python -m unittest discover -s tests + - name: Instalación de librerías y dependencias + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt + - name: Correr pruebas + run: | + coverage run -m unittest discover -s tests + coverage xml + - name: SonarCloud Scan + uses: SonarSource/sonarcloud-github-action@master + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} diff --git a/requirements.txt b/requirements.txt index 69d16165..499dd064 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ coverage==5.4 Faker==5.8.0 -PyQt5==5.15.2 +PyQt5 SQLAlchemy==1.3.22 diff --git a/sonar-project.properties b/sonar-project.properties new file mode 100644 index 00000000..ca6c7052 --- /dev/null +++ b/sonar-project.properties @@ -0,0 +1,18 @@ +sonar.projectKey=rnhuni_TutorialCancionesTags +sonar.organization=rnhuni +sonar.projectName=TutorialCancionesTags + +sonar.sources=./src +sonar.python.coverage.reportPaths=coverage.xml +sonar.exclusions=**/tests/**,**/__init__.py,**/app.py,**/users/** + +# This is the name and version displayed in the SonarCloud UI. +#sonar.projectName=TutorialCancionesTags +#sonar.projectVersion=1.0 + + +# Path is relative to the sonar-project.properties file. Replace "\" by "/" on Windows. +#sonar.sources=. + +# Encoding of the source code. Default is default system encoding +#sonar.sourceEncoding=UTF-8 \ No newline at end of file From f6314cbf48686dbddcb7a08f49e813c6a3531fb4 Mon Sep 17 00:00:00 2001 From: rnhdev Date: Sun, 3 Nov 2024 17:10:43 -0300 Subject: [PATCH 02/14] Prueba sonar --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 00bcb6e3..9323e2b7 100644 --- a/README.md +++ b/README.md @@ -1 +1 @@ -# test \ No newline at end of file +# test \ No newline at end of file From b7538f18abd4ae75ded13290ea7c8b506fba9e01 Mon Sep 17 00:00:00 2001 From: rnhdev Date: Sun, 3 Nov 2024 17:17:00 -0300 Subject: [PATCH 03/14] Correcciones sonar --- .github/workflows/test.yml | 14 ++++++++------ sonar-project.properties | 1 + 2 files changed, 9 insertions(+), 6 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 19ab3ca8..f717c30d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -19,15 +19,17 @@ jobs: with: python-version: '3.7' - name: Instalación de librerías y dependencias - run: | - python -m pip install --upgrade pip - pip install -r requirements.txt + run: pip install -r requirements.txt - name: Correr pruebas run: | coverage run -m unittest discover -s tests coverage xml - - name: SonarCloud Scan - uses: SonarSource/sonarcloud-github-action@master + - name: Run SonarCloud Scan for ServicioFacturacion + uses: SonarSource/sonarcloud-github-action@v2 + with: + args: > + -Dsonar.organization=rnhuni + -Dsonar.projectKey=rnhuni_TutorialCancionesTags + -Dsonar.projectBaseDir=. env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} diff --git a/sonar-project.properties b/sonar-project.properties index ca6c7052..65ee38d2 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -2,6 +2,7 @@ sonar.projectKey=rnhuni_TutorialCancionesTags sonar.organization=rnhuni sonar.projectName=TutorialCancionesTags +sonar.projectBaseDir=. sonar.sources=./src sonar.python.coverage.reportPaths=coverage.xml sonar.exclusions=**/tests/**,**/__init__.py,**/app.py,**/users/** From 35ce4af4ba4ffda124094dd27855fa488710a05b Mon Sep 17 00:00:00 2001 From: rnhdev Date: Sun, 3 Nov 2024 17:34:14 -0300 Subject: [PATCH 04/14] Correcciones sonar --- .github/workflows/test.yml | 2 ++ requirements.txt | 2 +- sonar-project.properties | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index f717c30d..14e33f2d 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -31,5 +31,7 @@ jobs: -Dsonar.organization=rnhuni -Dsonar.projectKey=rnhuni_TutorialCancionesTags -Dsonar.projectBaseDir=. + -Dsonar.sources=src + -Dsonar.coverageReportPaths=coverage.xml env: SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} diff --git a/requirements.txt b/requirements.txt index 499dd064..8ab936b3 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,4 +1,4 @@ -coverage==5.4 +coverage Faker==5.8.0 PyQt5 SQLAlchemy==1.3.22 diff --git a/sonar-project.properties b/sonar-project.properties index 65ee38d2..608520d0 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -3,7 +3,7 @@ sonar.organization=rnhuni sonar.projectName=TutorialCancionesTags sonar.projectBaseDir=. -sonar.sources=./src +sonar.sources=src sonar.python.coverage.reportPaths=coverage.xml sonar.exclusions=**/tests/**,**/__init__.py,**/app.py,**/users/** From c79260cff19ebf61ccb4f9a38e9fbe3dd677fbb5 Mon Sep 17 00:00:00 2001 From: rnhdev Date: Sun, 3 Nov 2024 17:39:24 -0300 Subject: [PATCH 05/14] Correcciones sonar --- .github/workflows/test.yml | 2 +- sonar-project.properties | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 14e33f2d..06d238fe 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -30,7 +30,7 @@ jobs: args: > -Dsonar.organization=rnhuni -Dsonar.projectKey=rnhuni_TutorialCancionesTags - -Dsonar.projectBaseDir=. + -Dsonar.projectBaseDir=src -Dsonar.sources=src -Dsonar.coverageReportPaths=coverage.xml env: diff --git a/sonar-project.properties b/sonar-project.properties index 608520d0..7289a5bf 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -2,8 +2,8 @@ sonar.projectKey=rnhuni_TutorialCancionesTags sonar.organization=rnhuni sonar.projectName=TutorialCancionesTags -sonar.projectBaseDir=. -sonar.sources=src +sonar.projectBaseDir=src +sonar.sources=. sonar.python.coverage.reportPaths=coverage.xml sonar.exclusions=**/tests/**,**/__init__.py,**/app.py,**/users/** From 3d014105072fabf7684e97900183029c0d3208e4 Mon Sep 17 00:00:00 2001 From: rnhdev Date: Sun, 3 Nov 2024 17:41:31 -0300 Subject: [PATCH 06/14] Correcciones sonar --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 06d238fe..4c34d1ac 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -31,7 +31,7 @@ jobs: -Dsonar.organization=rnhuni -Dsonar.projectKey=rnhuni_TutorialCancionesTags -Dsonar.projectBaseDir=src - -Dsonar.sources=src + -Dsonar.sources=. -Dsonar.coverageReportPaths=coverage.xml env: SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} From c45d942bbe6db5546db7ec9948a15286887a2531 Mon Sep 17 00:00:00 2001 From: rnhdev Date: Sun, 3 Nov 2024 17:43:59 -0300 Subject: [PATCH 07/14] Correcciones sonar --- .github/workflows/test.yml | 4 ++-- sonar-project.properties | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 4c34d1ac..3c534530 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -30,8 +30,8 @@ jobs: args: > -Dsonar.organization=rnhuni -Dsonar.projectKey=rnhuni_TutorialCancionesTags - -Dsonar.projectBaseDir=src - -Dsonar.sources=. + -Dsonar.projectBaseDir=. + -Dsonar.sources=./src -Dsonar.coverageReportPaths=coverage.xml env: SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} diff --git a/sonar-project.properties b/sonar-project.properties index 7289a5bf..65ee38d2 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -2,8 +2,8 @@ sonar.projectKey=rnhuni_TutorialCancionesTags sonar.organization=rnhuni sonar.projectName=TutorialCancionesTags -sonar.projectBaseDir=src -sonar.sources=. +sonar.projectBaseDir=. +sonar.sources=./src sonar.python.coverage.reportPaths=coverage.xml sonar.exclusions=**/tests/**,**/__init__.py,**/app.py,**/users/** From 3bbd48fe56c4260c442919ae46aa4695c36639aa Mon Sep 17 00:00:00 2001 From: rnhdev Date: Sun, 3 Nov 2024 17:48:08 -0300 Subject: [PATCH 08/14] Correcciones sonar --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 3c534530..446a358c 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -23,7 +23,7 @@ jobs: - name: Correr pruebas run: | coverage run -m unittest discover -s tests - coverage xml + coverage xml -o coverage.xml - name: Run SonarCloud Scan for ServicioFacturacion uses: SonarSource/sonarcloud-github-action@v2 with: From 4db0d74560974413da24804e41ebcb21c849ae14 Mon Sep 17 00:00:00 2001 From: rnhdev Date: Sun, 3 Nov 2024 17:55:13 -0300 Subject: [PATCH 09/14] Correcciones sonar --- .coverage | Bin 0 -> 53248 bytes .github/workflows/test.yml | 6 +-- Jenkinsfile | 86 ------------------------------------- sonar-project.properties | 2 +- 4 files changed, 4 insertions(+), 90 deletions(-) create mode 100644 .coverage delete mode 100644 Jenkinsfile diff --git a/.coverage b/.coverage new file mode 100644 index 0000000000000000000000000000000000000000..1947274b82ee89fc14c1c0607699ededdab2959a GIT binary patch literal 53248 zcmeI53w%_?y~pRg=gfIQ2#Fy)R;q+(LK2X-4+8R#H{oePmQAur7Lsh(-9UmoJi&_g zR*Gm9QP7LlT52mouc%xFfm$D}ijUSyTfMcnYHPJ>sVMfk_dh#lHlWZ?Kc8OX=VNC- zWb^%>nR905cV>R){CBg<>{(M|sc5J!o@k1sLPJnDBuQvYD1;EQ;KzX<{xASk9>8zu zBt8>bXwbqTjyDh4`pw8&>@4s~?e98e)=_(fd873`W2xB)1>zwT5DEwdgaSf=i~{~F z+sH2{kUG|+BGrx2R3cInO|WNYT-Er>IpaffD#uP8A7a}=14#%TrKO?DP$IrE)DlgE z>SB%2P^`H&Ruf6Zn(ITUhA6MynvB-cD;{ivYaXpQD6>DMaI6;gN=5785G{#VQzX$I zS{7|D$y5khOGVpKYy%u58mn)nH9`Y}-HStsXk9cBZLWzXSuY00YKuwn`gO#}@6kir z5Y3D!lBj`y)+wWb4V^=|tPT!T6HnCA-d86g%{2|tWJxHJ9bruz`q`FZqfNw{%2M%A zW2`wd%;sb)6^l2AqHWQd)>O3iv;!=mqVWfack*c9SWD=Dmasj8woX!~bLZ3S8B`B; zu7l1s$GNPXJJP0M=S-iQTbrsu@};d!E%fBT9<1S1{7ieEY2Q>l80Ex2rGs^aAZH_H(jb=}NNvLzrlFTrg<0Tl2a!MT}6$J zp?Fa76&v zH&i3PXHUszD}wqG{n1Vt1l`iP1U_>i_{Y275=k|LKHqn`89H91>G`93o~h%s3*id- ztgo+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Uc~FQvf$0sdIxf&c&j literal 0 HcmV?d00001 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 446a358c..cb1f6d88 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -22,8 +22,8 @@ jobs: run: pip install -r requirements.txt - name: Correr pruebas run: | - coverage run -m unittest discover -s tests - coverage xml -o coverage.xml + python -m coverage run -m unittest discover -s tests -v + python -m coverage xml - name: Run SonarCloud Scan for ServicioFacturacion uses: SonarSource/sonarcloud-github-action@v2 with: @@ -31,7 +31,7 @@ jobs: -Dsonar.organization=rnhuni -Dsonar.projectKey=rnhuni_TutorialCancionesTags -Dsonar.projectBaseDir=. - -Dsonar.sources=./src + -Dsonar.sources=src -Dsonar.coverageReportPaths=coverage.xml env: SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} diff --git a/Jenkinsfile b/Jenkinsfile deleted file mode 100644 index 7a880eac..00000000 --- a/Jenkinsfile +++ /dev/null @@ -1,86 +0,0 @@ -pipeline { - agent any - environment { - HOME = "${WORKSPACE}" - GIT_CREDENTIAL_ID = '67fc884e-63ed-47cc-8a49-e91b798c7178' - GIT_REPO = 'TutorialCancionesTags' - } - stages { - stage('Checkout') { - steps { - scmSkip(deleteBuild: true, skipPattern:'.*\\[ci-skip\\].*') - git branch: 'main', - credentialsId: env.GIT_CREDENTIAL_ID, - url: 'https://github.com/MISW-4101-Practicas/' + env.GIT_REPO - } - } - stage('Install libraries') { - steps { - script { - docker.image('python:3.7.6').inside { - sh 'pip install --user -r requirements.txt' - } - } - } - } - stage('Testing') { - steps { - script { - docker.image('python:3.7.6').inside { - sh 'python -m unittest discover -s tests -v' - } - } - } - } - stage('Coverage') { - steps { - script { - docker.image('python:3.7.6').inside { - sh ''' - python -m coverage run -m unittest discover -s tests -v - python -m coverage html - ''' - } - } - } - } - stage('Report') { - steps { - publishHTML (target : [allowMissing: false, - alwaysLinkToLastBuild: true, - keepAll: true, - reportDir: 'htmlcov/', - reportFiles: 'index.html', - reportName: 'Coverage Report', - reportTitles: 'Coverage Report'] - ) - } - } - stage('Gitinspector') { - steps { - script { - docker.image('gitinspector-isis2603').inside('--entrypoint=""') { - sh ''' - mkdir -p ./reports/ - gitinspector --file-types="py" --format=html --AxU -w -T -x author:Bocanegra -x author:estudiante > ./reports/index.html - ''' - } - } - withCredentials([usernamePassword(credentialsId: env.GIT_CREDENTIAL_ID, passwordVariable: 'GIT_PASSWORD', usernameVariable: 'GIT_USERNAME')]) { - sh('git config --global user.email "ci-isis2603@uniandes.edu.co"') - sh('git config --global user.name "ci-isis2603"') - sh('git add ./reports/index.html') - sh('git commit -m "[ci-skip] GitInspector report added"') - sh('git pull https://${GIT_USERNAME}:${GIT_PASSWORD}@github.com/MISW-4101-Practicas/${GIT_REPO} main') - sh('git push https://${GIT_USERNAME}:${GIT_PASSWORD}@github.com/MISW-4101-Practicas/${GIT_REPO} main') - } - } - } - } - post { - always { - // Clean workspace - cleanWs deleteDirs: true - } - } -} diff --git a/sonar-project.properties b/sonar-project.properties index 65ee38d2..608520d0 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -3,7 +3,7 @@ sonar.organization=rnhuni sonar.projectName=TutorialCancionesTags sonar.projectBaseDir=. -sonar.sources=./src +sonar.sources=src sonar.python.coverage.reportPaths=coverage.xml sonar.exclusions=**/tests/**,**/__init__.py,**/app.py,**/users/** From c32c7e4d14607d434bae064948cedf1c75cdb488 Mon Sep 17 00:00:00 2001 From: rnhdev Date: Sun, 3 Nov 2024 18:04:03 -0300 Subject: [PATCH 10/14] Correcciones sonar --- .coveragerc | 36 +++++++++--------------------------- .github/workflows/test.yml | 2 +- 2 files changed, 10 insertions(+), 28 deletions(-) diff --git a/.coveragerc b/.coveragerc index fecdbb13..283a3bfe 100644 --- a/.coveragerc +++ b/.coveragerc @@ -1,28 +1,10 @@ -# .coveragerc to control coverage.py +# .coveragerc [run] -branch = True -source = src -# omit = bad_file.py - -[paths] -source = - src/ - */site-packages/ - -[report] -# Regexes for lines to exclude from consideration -exclude_lines = - # Have to re-enable the standard pragma - pragma: no cover - - # Don't complain about missing debug-only code: - def __repr__ - if self\.debug - - # Don't complain if tests don't hit defensive assertion code: - raise AssertionError - raise NotImplementedError - - # Don't complain if non-runnable code isn't run: - if 0: - if __name__ == .__main__.: +relative_files = True +omit = + */__init__.py + *__init__.py + *.py_ + tests/* + */app.py + */venv/* diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index cb1f6d88..1d3bf81f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -32,6 +32,6 @@ jobs: -Dsonar.projectKey=rnhuni_TutorialCancionesTags -Dsonar.projectBaseDir=. -Dsonar.sources=src - -Dsonar.coverageReportPaths=coverage.xml + -Dsonar.python.coverage.reportPaths=coverage.xml env: SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} From 6f76fadae8165ec55b41c0a1cc8c2dfad81417c6 Mon Sep 17 00:00:00 2001 From: rnhdev Date: Sun, 3 Nov 2024 18:31:04 -0300 Subject: [PATCH 11/14] Correcciones sonar --- .github/workflows/test.yml | 2 +- sonar-project.properties | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 1d3bf81f..acce4f4a 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -31,7 +31,7 @@ jobs: -Dsonar.organization=rnhuni -Dsonar.projectKey=rnhuni_TutorialCancionesTags -Dsonar.projectBaseDir=. - -Dsonar.sources=src + -Dsonar.sources=. -Dsonar.python.coverage.reportPaths=coverage.xml env: SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} diff --git a/sonar-project.properties b/sonar-project.properties index 608520d0..5f39a962 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -3,7 +3,7 @@ sonar.organization=rnhuni sonar.projectName=TutorialCancionesTags sonar.projectBaseDir=. -sonar.sources=src +sonar.sources=. sonar.python.coverage.reportPaths=coverage.xml sonar.exclusions=**/tests/**,**/__init__.py,**/app.py,**/users/** From b4d3f1c0e9b96bb6cfdee372af7a7702f8b41187 Mon Sep 17 00:00:00 2001 From: Luis Daniel Angel Date: Sun, 3 Nov 2024 16:42:09 -0500 Subject: [PATCH 12/14] Validate coverage --- .github/workflows/test.yml | 4 ++-- sonar-project.properties | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index acce4f4a..a4d2ac82 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -28,8 +28,8 @@ jobs: uses: SonarSource/sonarcloud-github-action@v2 with: args: > - -Dsonar.organization=rnhuni - -Dsonar.projectKey=rnhuni_TutorialCancionesTags + -Dsonar.organization=langelb-1 + -Dsonar.projectKey=langelb_TutorialCancionesTags -Dsonar.projectBaseDir=. -Dsonar.sources=. -Dsonar.python.coverage.reportPaths=coverage.xml diff --git a/sonar-project.properties b/sonar-project.properties index 5f39a962..69597729 100644 --- a/sonar-project.properties +++ b/sonar-project.properties @@ -1,5 +1,5 @@ -sonar.projectKey=rnhuni_TutorialCancionesTags -sonar.organization=rnhuni +sonar.projectKey=langelb_TutorialCancionesTags +sonar.organization=langelb-1 sonar.projectName=TutorialCancionesTags sonar.projectBaseDir=. From b19ac2e67235ae70a7f6b6b0d7d485f9c4c6c99b Mon Sep 17 00:00:00 2001 From: Luis Daniel Angel Date: Sun, 3 Nov 2024 16:43:03 -0500 Subject: [PATCH 13/14] Validate coverage --- .github/workflows/test.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index a4d2ac82..1f11d550 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -34,4 +34,4 @@ jobs: -Dsonar.sources=. -Dsonar.python.coverage.reportPaths=coverage.xml env: - SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} + SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} \ No newline at end of file From 766d9d1cd8561b2e1ff2267df9af0690ae7e2950 Mon Sep 17 00:00:00 2001 From: Luis Daniel Angel Date: Sun, 3 Nov 2024 20:20:17 -0500 Subject: [PATCH 14/14] =?UTF-8?q?Duplicidad=20funci=C3=B3n?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/logica/coleccion.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/logica/coleccion.py b/src/logica/coleccion.py index a7d9d634..000fcb03 100644 --- a/src/logica/coleccion.py +++ b/src/logica/coleccion.py @@ -163,6 +163,14 @@ def buscar_canciones_por_interprete(self, interprete_nombre): Cancion.interpretes.any(Interprete.nombre.ilike('%{0}%'.format(interprete_nombre)))).all() return canciones + def buscar_canciones_por_interpretes(self, interprete_nombre): + if interprete_nombre == "": + canciones = session.query(Cancion).all() + else: + canciones = session.query(Cancion).filter( + Cancion.interpretes.any(Interprete.nombre.ilike('%{0}%'.format(interprete_nombre)))).all() + return canciones + def asociar_cancion(self, cancion_id, album_id): cancion = session.query(Cancion).filter(Cancion.id == cancion_id).first() album = session.query(Album).filter(Album.id == album_id).first()