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

fix(logs): unreachable profile-attributes in logs #486

Merged
merged 1 commit into from
Apr 19, 2024

Conversation

Guts
Copy link
Owner

@Guts Guts commented Apr 18, 2024

Following #481, this PR fixes the case where a profile is not installed because of not matching defined rules but QDT is failing because of Splash Screen job tries to log a profile.name that does not exist in that case:

2024-04-18 15:40:56||ERROR||check_path||check_path_exists||145||C:\Users\runneradmin\AppData\Roaming\QGIS\QGIS3\profiles\QDT Only Linux\QGIS\QGIS3.ini doesn't exist. Attempt 2/2. Game over.
2024-04-18 15:40:56||INFO||qgis_ini_handler||__init__||117||The specified file does not exist: C:\Users\runneradmin\AppData\Roaming\QGIS\QGIS3\profiles\QDT Only Linux\QGIS\QGIS3.ini.
2024-04-18 15:40:56||INFO||job_splash_screen||run||135||No profile.json found for profile 'C:\Users\runneradmin\.cache\qgis-deployment-toolbelt\repositories\qdt-demo-scenario\examples\profiles\only_linux'
2024-04-18 15:40:56||ERROR||bouncer||exit_cli_error||43||'NoneType' object has no attribute 'name'
Traceback (most recent call last):
  File "d:\a\qgis-deployment-cli\qgis-deployment-cli\qgis_deployment_toolbelt\commands\deployment.py", line 205, in run
    job.run()
  File "d:\a\qgis-deployment-cli\qgis-deployment-cli\qgis_deployment_toolbelt\jobs\job_splash_screen.py", line 143, in run
    f"{profile_installed.name} ({profile_installed.path_in_qgis})"
AttributeError: 'NoneType' object has no attribute 'name'
2024-04-18 15:40:56||ERROR||bouncer||exit_cli_error||44||Please, read the full detailed log: C:\Users\runneradmin\.cache\qgis-deployment-toolbelt\logs\QGISDeploymentToolbelt_0.33.0.log
'NoneType' object has no attribute 'name'
2024-04-18 15:40:57||WARNING||shortcuts||__init__||110||Executable does not exist: C:\Program Files\QGIS 3.34.4\bin\qgis-ltr-bin.exe. Shortcuts might not work. Check and fix your scenario.
2024-04-18 15:40:57||WARNING||shortcuts||__init__||110||Executable does not exist: C:\Program Files\QGIS 3.34.4\bin\qgis-ltr-bin.exe. Shortcuts might not work. Check and fix your scenario.
2024-04-18 15:40:57||WARNING||job_splash_screen||run||162||Profile qdt_demo -C:\Users\runneradmin\AppData\Roaming\QGIS\QGIS3\profiles\qdt_demo\images\splash.png dimensions (1000, 479) do not comply with  dimensions recomended by QGIS for splash screen: 600x300.
2024-04-18 15:40:57||ERROR||check_path||check_path_exists||145||C:\Users\runneradmin\AppData\Roaming\QGIS\QGIS3\profiles\QDT Only Linux\QGIS\QGIS3.ini doesn't exist. Attempt 2/2. Game over.
2024-04-18 15:40:57||ERROR||bouncer||exit_cli_error||43||'NoneType' object has no attribute 'name'
Traceback (most recent call last):
  File "d:\a\qgis-deployment-cli\qgis-deployment-cli\qgis_deployment_toolbelt\commands\deployment.py", line 205, in run
    job.run()
  File "d:\a\qgis-deployment-cli\qgis-deployment-cli\qgis_deployment_toolbelt\jobs\job_splash_screen.py", line 143, in run
    f"{profile_installed.name} ({profile_installed.path_in_qgis})"
AttributeError: 'NoneType' object has no attribute 'name'
2024-04-18 15:40:57||ERROR||bouncer||exit_cli_error||44||Please, read the full detailed log: C:\Users\runneradmin\.cache\qgis-deployment-toolbelt\logs\QGISDeploymentToolbelt_0.33.0.log
'NoneType' object has no attribute 'name'

@Guts Guts self-assigned this Apr 18, 2024
@github-actions github-actions bot added bug Something isn't working jobs Scenarios and jobs labels Apr 18, 2024
Copy link

sonarcloud bot commented Apr 18, 2024

Quality Gate Passed Quality Gate passed

Issues
0 New issues
0 Accepted issues

Measures
0 Security Hotspots
No data about Coverage
0.0% Duplication on New Code

See analysis details on SonarCloud

@codecov-commenter
Copy link

codecov-commenter commented Apr 18, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 70.81%. Comparing base (f8620f3) to head (9dbd953).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #486      +/-   ##
==========================================
- Coverage   70.86%   70.81%   -0.05%     
==========================================
  Files          47       47              
  Lines        2904     2906       +2     
  Branches      630      631       +1     
==========================================
  Hits         2058     2058              
- Misses        666      668       +2     
  Partials      180      180              
Flag Coverage Δ
unittests 70.26% <66.66%> (-0.09%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files Coverage Δ
qgis_deployment_toolbelt/jobs/job_splash_screen.py 78.57% <100.00%> (+0.79%) ⬆️

... and 1 file with indirect coverage changes

Copy link
Collaborator

@jmkerloch jmkerloch left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Guts Guts merged commit 1d2b672 into main Apr 19, 2024
25 checks passed
@Guts Guts deleted the fix/unreachable-profile-attribute-in-logs branch April 19, 2024 07:54
Guts added a commit that referenced this pull request Apr 23, 2024
…matically in jobs (#487)

This PR is a following up of #481 and #486.

After some real-life testing of the profile deployment rules, it became
clear that the initial implementation was clumsy.

By placing the filtering of profiles based on rules in the
qprofiles-synchronizer job alone, we forget that other jobs based on the
content of downloaded profiles also need to respect the rules:
qplugins-synchronizer, etc.

This PR fixes this by moving the rules filtering logic
right into the generic job class and make sure that every job which
relies on downloaded profiles use the same method to filter on rules.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working jobs Scenarios and jobs
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants