Skip to content
This repository has been archived by the owner on Jan 19, 2025. It is now read-only.

feat: bug fixes and improvements for migration #1235

Merged
merged 23 commits into from
Mar 19, 2023
Merged

Conversation

Aclrian
Copy link
Contributor

@Aclrian Aclrian commented Mar 1, 2023

Closes #1259.

Summary of Changes

Some Improvements to the migrate command:

  • include documentation similarity to similarity between two functions
  • include function similarity and documentation similarity to similarity between two classes
    • add hash function to Function and FunctionDocumentation
  • handle duplicated annotations
    • mark annotations with same type and target as unsure and generate a comment where they differ
  • improved output for migration by not printing each line separately
  • fix detection of global function in StrictDiffer
  • fix weighted levenshtein distance: now higher level changes should have increased costs

Testing Instructions

run test_base_differ.py and test_mapping.py

@Aclrian Aclrian added the migration Migration of annotation to a new API version label Mar 1, 2023
@github-actions
Copy link

github-actions bot commented Mar 1, 2023

🦙 MegaLinter status: ✅ SUCCESS

Descriptor Linter Files Fixed Errors Elapsed time
✅ JSON eslint-plugin-jsonc 4 0 0 2.07s
✅ JSON jsonlint 4 0 0.26s
✅ JSON npm-package-json-lint yes no 0.64s
✅ JSON prettier 4 0 0 1.3s
✅ JSON v8r 4 0 2.38s
✅ PYTHON black 10 0 0 2.36s
✅ PYTHON flake8 10 0 0.86s
✅ PYTHON isort 10 0 0 0.97s
✅ PYTHON mypy 10 0 4.63s
✅ PYTHON pylint 10 0 8.17s
✅ REPOSITORY git_diff yes no 0.6s

See detailed report in MegaLinter reports
Set VALIDATE_ALL_CODEBASE: true in mega-linter.yml to validate all sources, not only the diff

MegaLinter is graciously provided by OX Security

@Aclrian Aclrian force-pushed the migration-quickfixes branch from b64b3d5 to 133df93 Compare March 1, 2023 19:16
@codecov-commenter
Copy link

codecov-commenter commented Mar 8, 2023

Codecov Report

Merging #1235 (bde3c86) into main (6c3bd43) will increase coverage by 0.11%.
The diff coverage is 88.88%.

@@            Coverage Diff             @@
##             main    Safe-DS/API-Editor#1235      +/-   ##
==========================================
+ Coverage   66.43%   66.54%   +0.11%     
==========================================
  Files         168      167       -1     
  Lines        7185     7183       -2     
  Branches      594      594              
==========================================
+ Hits         4773     4780       +7     
+ Misses       2143     2134       -9     
  Partials      269      269              
Components Coverage Δ
backend 81.66% <ø> (ø)
desktop 2.67% <ø> (ø)
gui 43.03% <ø> (ø)
package-parser 75.77% <88.88%> (+0.22%) ⬆️
Impacted Files Coverage Δ
.../package_parser/processing/annotations/__init__.py 100.00% <ø> (ø)
...arser/processing/migration/model/_strict_differ.py 91.89% <40.00%> (-3.83%) ⬇️
...parser/package_parser/processing/api/model/_api.py 86.14% <50.00%> (-0.32%) ⬇️
...kage_parser/processing/api/model/_documentation.py 97.14% <50.00%> (-2.86%) ⬇️
...er/package_parser/processing/migration/_migrate.py 65.36% <93.33%> (+7.47%) ⬆️
...ckage_parser/processing/migration/model/_differ.py 91.47% <100.00%> (+2.48%) ⬆️

@Aclrian Aclrian changed the title feat: Finalize migration feat: bug fixes and improvements for migration Mar 15, 2023
@Aclrian Aclrian marked this pull request as ready for review March 15, 2023 22:34
@Aclrian Aclrian requested a review from lars-reimann as a code owner March 15, 2023 22:34
@lars-reimann lars-reimann marked this pull request as draft March 16, 2023 09:14
@Aclrian Aclrian removed the migration Migration of annotation to a new API version label Mar 17, 2023
@Aclrian Aclrian marked this pull request as ready for review March 17, 2023 17:11
@lars-reimann
Copy link
Member

Feel free to merge this in when it's done. It should now work again as expected.

@lars-reimann lars-reimann merged commit 288d505 into main Mar 19, 2023
@lars-reimann lars-reimann deleted the migration-quickfixes branch March 19, 2023 09:27
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Mark Annotations from ManyToManyMappings as unsure
3 participants