Skip to content

Conversation

nicogodet
Copy link
Contributor

Fixes #660

It's easier te proceed that way than :

  • checking if destination branch exists in local folder
  • create a new branch
  • pull the distant branch in local repo

@github-actions github-actions bot added the bug Something isn't working label Apr 30, 2025
Copy link

codecov bot commented Apr 30, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #661      +/-   ##
==========================================
+ Coverage   71.84%   71.88%   +0.04%     
==========================================
  Files          48       48              
  Lines        3271     3276       +5     
  Branches      576      577       +1     
==========================================
+ Hits         2350     2355       +5     
  Misses        705      705              
  Partials      216      216              
Flag Coverage Δ
unittests 71.27% <100.00%> (+0.04%) ⬆️

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

Files with missing lines Coverage Δ
...loyment_toolbelt/profiles/profiles_handler_base.py 70.05% <100.00%> (+0.82%) ⬆️

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@nicogodet nicogodet marked this pull request as draft April 30, 2025 14:27
nicogodet added a commit that referenced this pull request May 20, 2025
`DESTINATION_BRANCH_TO_USE` 

- is "declared" as a string


https://github.com/qgis-deployment/qgis-deployment-toolbelt-cli/blob/38859d135c7561f8b3bc2d6525405f64f56d4e1c/qgis_deployment_toolbelt/profiles/profiles_handler_base.py#L62

- is always populated with a string in : 
   - __init__
-
https://github.com/qgis-deployment/qgis-deployment-toolbelt-cli/blob/38859d135c7561f8b3bc2d6525405f64f56d4e1c/qgis_deployment_toolbelt/profiles/local_git_handler.py#L98-L104
     ```python
def get_active_branch_from_local_repository(self,
local_git_repository_path: Path | None = None) -> str:
     ```
   - ...

Without this change, the type of this variable becomes mixed `str |
bytes`

But indeed, it needs to be converted to bytes at some point
([here](https://github.com/qgis-deployment/qgis-deployment-toolbelt-cli/blob/38859d135c7561f8b3bc2d6525405f64f56d4e1c/qgis_deployment_toolbelt/profiles/profiles_handler_base.py#L492-L500))
but it's cleaner to let the function handles the conversion instead of
store the branch name as bytes

In my case, I relied on str type when testing
#661
and I end up comparing `"main"` with `b"main"` equals False
@github-actions github-actions bot added the quality Tests, project resiliency, etc. label May 20, 2025
@nicogodet nicogodet marked this pull request as ready for review May 20, 2025 13:46
Copy link

@nicogodet nicogodet marked this pull request as draft August 6, 2025 11:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working quality Tests, project resiliency, etc.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG]: Changing branch in qprofiles-downloader has no effect
1 participant