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

[GitLab] Fixes to inline comments #1428

Merged
merged 5 commits into from
Apr 16, 2024
Merged

Commits on Mar 6, 2024

  1. Upgrade node engine to >=18 & @types/node to 18.19.18

    The currently used node environment has reached end of life. Updating to 18.x which is the version with Maintenance status for Node.js.
    
    - Upgraded node engine to >= 18
    - Upgraded @types/node to 18.19.18
    heltoft committed Mar 6, 2024
    Configuration menu
    Copy the full SHA
    543f127 View commit details
    Browse the repository at this point in the history
  2. Bumped dependencies related to node 18

    Since we are now using node engine 18 we will need to bump some dependencies to be able to build and run tests properly.
    heltoft committed Mar 6, 2024
    Configuration menu
    Copy the full SHA
    3f3f7ec View commit details
    Browse the repository at this point in the history
  3. [GitLab] Move to gitbeaker/rest

    Major version 36 of gitbeaker contains changes to the type system and the structure of the framework.
    
    Moved to gitbeaker/rest which is the expected package to consume going forward, and adjusted our usage of the types to match the changes in the framework.
    
    Additionally gitbeaker now leverages native-fetch  under the hood which nock does not support. Version 4.0.0 of nock in beta can handle testing native-fetch, but does not yet support recording fixtures. To continue using nock for testing without updating to the beta-version, a fetch polyfill has been introduced to use for the gitlab api tests.
    heltoft committed Mar 6, 2024
    Configuration menu
    Copy the full SHA
    f42a724 View commit details
    Browse the repository at this point in the history
  4. [GitLab] Calculate inline comment positions correctly

    To be able to correctly add inline comments on GitLab we need to provide the file path pre & post change, along with the line number pre & post change.
    
    Introduced an inlinePositionParser that calculates these values by inspecting the structured diff.
    
    A binary search approach was used to make sure that the work to calculate the changes does not grow exponentially with the number of changes in the diff.
    heltoft committed Mar 6, 2024
    Configuration menu
    Copy the full SHA
    c2c9587 View commit details
    Browse the repository at this point in the history
  5. [GitLab] Do not delete system resolved danger inline comments

    Removing system resolved danger discussions on old versions of the diff can result in a state where the system note becomes the first note on the discussion resulting in poor change history on the MR.
    
    To remedy this we look for system notes on resolved danger discussions and abort deletion.
    
    This could be considered a brittle check, as there is no data to check to see if the system note did resolve it. However currently I am unaware of any other events triggering system notes on a discussion itself.
    As long as that assumption holds true the check should work as intended and not delete system resolved discussions.
    heltoft committed Mar 6, 2024
    Configuration menu
    Copy the full SHA
    d353324 View commit details
    Browse the repository at this point in the history