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: url encode workflows external id #1519

Merged
merged 1 commit into from
Nov 21, 2023

Conversation

ddonukis
Copy link
Contributor

@ddonukis ddonukis commented Nov 21, 2023

Description

Workflows service allows arbitrary strings as workflow external id or version id. However, these are used as url path parameters and should be url-encoded. Fixing it now.

Checklist:

  • Tests added/updated.
  • Documentation updated. Documentation is generated from docstrings - these must be updated according to your change.
    If a new method has been added it should be referenced in cognite.rst in order to generate docs based on its docstring.
  • Changelog updated in CHANGELOG.md.
  • Version bumped. If triggering a new release is desired, bump the version number in _version.py and pyproject.toml per semantic versioning.

@ddonukis ddonukis requested review from a team as code owners November 21, 2023 15:26
Copy link

codecov bot commented Nov 21, 2023

Codecov Report

Merging #1519 (d6c5354) into master (4912644) will increase coverage by 0.07%.
The diff coverage is 100.00%.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1519      +/-   ##
==========================================
+ Coverage   91.72%   91.80%   +0.07%     
==========================================
  Files         120      120              
  Lines       15587    15588       +1     
==========================================
+ Hits        14297    14310      +13     
+ Misses       1290     1278      -12     
Files Coverage Δ
cognite/client/_api/workflows.py 81.35% <100.00%> (+0.15%) ⬆️
cognite/client/_version.py 100.00% <100.00%> (ø)

... and 2 files with indirect coverage changes

Copy link
Contributor

@doctrino doctrino left a comment

Choose a reason for hiding this comment

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

There are a few more strings used directly in the URL in the workflows.py, 103, 139, and 206.

In addition, is this worth a simple test?

@ddonukis
Copy link
Contributor Author

There are a few more strings used directly in the URL in the workflows.py, 103, 139, and 206.

In addition, is this worth a simple test?

The other url path params are provided by the Workflows service and are uuids, that's why I didn't update those.

Do you think they should be quoted anyways to be safe?

@doctrino
Copy link
Contributor

There are a few more strings used directly in the URL in the workflows.py, 103, 139, and 206.
In addition, is this worth a simple test?

The other url path params are provided by the Workflows service and are uuids, that's why I didn't update those.

Do you think they should be quoted anyways to be safe?

Ah, no I don't think it is necessary.

@doctrino doctrino self-requested a review November 21, 2023 15:39
@ddonukis ddonukis merged commit 7c26abb into master Nov 21, 2023
7 checks passed
@ddonukis ddonukis deleted the fix/urlencode_workflow_external_id branch November 21, 2023 15:41
@haakonvt
Copy link
Contributor

In addition, is this worth a simple test?

@ddonukis 👀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants