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

Dds 1861 - new v3 version to fix endpoints - fix the files endpoints #1505

Merged

Conversation

rv0lt
Copy link
Member

@rv0lt rv0lt commented Jan 18, 2024

Read this before submitting the PR

  1. Always create a Draft PR first
  2. Go through sections 1-5 below, fill them in and check all the boxes
  3. Make sure that the branch is updated; if there's an "Update branch" button at the bottom of the PR, rebase or update branch.
  4. When all boxes are checked, information is filled in, and the branch is updated: mark as Ready For Review and tag reviewers (top right)
  5. Once there is a submitted review, implement the suggestions (if reasonable, otherwise discuss) and request an new review.

If there is a field which you are unsure about, enter the edit mode of this description or go to the PR template; There are invisible comments providing descriptions which may be of help.

1. Description / Summary

Some endpoints were not developed according to the OpenAPI standard, this means that we were not possible to document them properly, furthermore according to new regulations for public organisms, we actually need to have them according to OpenAPI. This PR is the first on a series of them to fix several endpoints. Therefore:

  • After merging, there will be two endpoints that are possible to make requests:

url/api/v1 → Will keep working as always

url/api/v3 → Contains the new version of the endpoints. Keeps all the previous one as well as fixed version for the endpoints related to files.

Subsequent PR will focus on fix the other types of endpoints.

  • The new tests for this version 3 have been placed, under tests/tests_v3. They are duplicated of the old ones, but with the requests fixed. When the old version is finally removed, this files can be just replaced and the coverage will maintain.

  • The two documentation versions are now hosted in /api/documentation/v3/ or /api/documentation/v1/


A new file swaggerv3.yaml serves as the documentation for the new version.

New descriptions to clarify future users have also been provided.

2. Jira task / GitHub issue

Link to the github issue or add the Jira task ID here.

3. Type of change

What type of change(s) does the PR contain?

Check the relevant boxes below. For an explanation of the different sections, enter edit mode of this PR description template.

  • New feature
    • Breaking: Why / How? Add info here.
    • Non-breaking
  • Database change: Remember the to include a new migration version, or explain here why it's not needed.
  • Bug fix
  • Security Alert fix
    • Package update
      • Major version update
  • Documentation
  • Workflow
  • Tests only

4. Additional information

5. Actions / Scans

Check the boxes when the specified checks have passed.

For information on what the different checks do and how to fix it if they're failing, enter edit mode of this description or go to the PR template.

  • Black
  • Prettier
  • Yamllint
  • Tests
  • CodeQL
  • Trivy
  • Snyk

@rv0lt rv0lt marked this pull request as draft January 18, 2024 15:13
Copy link

@github-advanced-security github-advanced-security bot left a comment

Choose a reason for hiding this comment

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

SnykCode found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.

Copy link

codecov bot commented Jan 25, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 91.67%. Comparing base (1c55639) to head (afbb089).
Report is 1 commits behind head on dev.

❗ Current head afbb089 differs from pull request most recent head db50f17. Consider uploading reports for the commit db50f17 to get more accurate results

Additional details and impacted files
@@            Coverage Diff             @@
##              dev    #1505      +/-   ##
==========================================
+ Coverage   91.48%   91.67%   +0.19%     
==========================================
  Files          29       29              
  Lines        4637     4747     +110     
==========================================
+ Hits         4242     4352     +110     
  Misses        395      395              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

tests/tests_v3/__init__.py Dismissed Show resolved Hide resolved
@rv0lt rv0lt self-assigned this Jan 31, 2024
@rv0lt rv0lt requested a review from valyo February 29, 2024 15:32
@rv0lt
Copy link
Member Author

rv0lt commented Feb 29, 2024

I added better explanations abt this thing with the s3 keys operations

dds_web/static/swagger.yaml Outdated Show resolved Hide resolved
dds_web/static/swagger.yaml Outdated Show resolved Hide resolved
dds_web/static/swagger.yaml Outdated Show resolved Hide resolved
dds_web/static/swagger.yaml Outdated Show resolved Hide resolved
dds_web/static/swaggerv3.yaml Outdated Show resolved Hide resolved
dds_web/static/swaggerv3.yaml Outdated Show resolved Hide resolved
dds_web/static/swagger.yaml Outdated Show resolved Hide resolved
Copy link
Member

@valyo valyo left a comment

Choose a reason for hiding this comment

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

line 1285 in swagger.yaml and line 1246 in swaggerv3.yaml:
operationId: allUnits
should not be the same as for /unit/info/all
just noticed that it is the same for the get method of /motd
All operationId should be checked (I guess they don't relate to anything in the code, just unique tags for swagger)

Copy link
Member

@valyo valyo left a comment

Choose a reason for hiding this comment

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

Sorry that I forgot the usage explanation last time, it is good but I added some formatting and clarification suggestions.
Also, it needs to go into swaggerv3.yaml too.
I hope this is the last thing and we can get rid of it :)

dds_web/static/swagger.yaml Outdated Show resolved Hide resolved
SPRINTLOG.md Outdated Show resolved Hide resolved
Co-authored-by: Valentin Georgiev <[email protected]>
@rv0lt rv0lt requested a review from valyo March 13, 2024 09:51
SPRINTLOG.md Show resolved Hide resolved
@rv0lt rv0lt requested a review from valyo March 13, 2024 10:00
@rv0lt rv0lt merged commit 594ffc4 into dev Mar 13, 2024
13 checks passed
@rv0lt rv0lt deleted the DDS-1861-Fix-the-Files-endpoints-according-to-the-OpenApi-standard branch March 13, 2024 10:08
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.

2 participants