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

Refacto: move rules context into a structured object #491

Merged
merged 2 commits into from
Apr 23, 2024

Conversation

Guts
Copy link
Owner

@Guts Guts commented Apr 23, 2024

This PR is a following up of #481.

It's mainly a code structure improvement which aims to improve readability, testing and maintainability:

  • create an object
  • move it from utils to profiles since it's only related to QDT profiles management
  • add methods to export as dict and JSON
  • add unit test
  • use it in documentation and GenericJob.filter_on_rules

Next (spoiler alert): a CLI command to generate the rules context to make the rules writing more handy

@Guts Guts requested a review from jmkerloch April 23, 2024 09:58
@Guts Guts self-assigned this Apr 23, 2024
@github-actions github-actions bot added documentation Improvements or additions to documentation jobs Scenarios and jobs quality Tests, project resiliency, etc. labels Apr 23, 2024
Copy link

sonarcloud bot commented Apr 23, 2024

Quality Gate Passed Quality Gate passed

Issues
2 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 Report

All modified and coverable lines are covered by tests ✅

Project coverage is 70.47%. Comparing base (1b76259) to head (241d859).

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #491      +/-   ##
==========================================
+ Coverage   70.19%   70.47%   +0.27%     
==========================================
  Files          48       48              
  Lines        3013     3028      +15     
  Branches      648      653       +5     
==========================================
+ Hits         2115     2134      +19     
+ Misses        710      704       -6     
- Partials      188      190       +2     
Flag Coverage Δ
unittests 69.84% <100.00%> (+0.28%) ⬆️

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

Files Coverage Δ
qgis_deployment_toolbelt/jobs/generic_job.py 89.15% <100.00%> (ø)
qgis_deployment_toolbelt/jobs/job_splash_screen.py 67.85% <ø> (ø)
qgis_deployment_toolbelt/profiles/rules_context.py 100.00% <100.00%> (ø)

... 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 c7f7608 into main Apr 23, 2024
26 checks passed
@Guts Guts deleted the refacto/rules-context-object branch April 23, 2024 10:32
@Guts Guts linked an issue Apr 23, 2024 that may be closed by this pull request
1 task
Guts added a commit that referenced this pull request Apr 23, 2024
…ent (#492)

Following up #491.

This PR adds a new CLI command to allow export rules context in the
current environment. It aims to make rules writing easier:

```sh
> qdt export-rules-context -o qdt_rules_context.json
Rules context exported in qdt_rules_context.json
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation jobs Scenarios and jobs quality Tests, project resiliency, etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature Request]: add conditions on profile deployment
3 participants