Skip to content

Conversation

@emjay0921
Copy link
Contributor

@emjay0921 emjay0921 commented Nov 21, 2024

Why is this change needed?

To fix the spp_api initialization error.

How was the change implemented?

Added and overridden the function handle_error since not overriding this is the cause of the api not initializing properly.

New unit tests

None

Unit tests executed by the author

None

How to test manually

In Odoo:

  • Install or Upgrade spp_api.
  • Install spp_api_records.
  • Activate Developer Mode.
  • Navigate to Users and Find your User Account.
  • In Allowed APIs tab check if spp_api is in the list.
  • Click the Key Icon in the right side of OpenAPI Token.
  • A pop-up will open, click the Copy. (Paste this on a notepad this is important, this is the bearer token.)

In Postman: (Download this postman collection:
OpenSPP-ACF API.postman_collection.json)

  • Open the postman.
  • Import the postman collection.
  • Click the created collection from the import (OpenSPP-ACF API).
  • Go to Variables.
  • In (Current Value) user_prog_token and user_reg_token replace the value after 'Bearer' with the bearer token you copied before. (Make sure the word Bearer and a blank space is still there before the bearer token you pasted.).
    e.g Bearer ey........
  • In (Current Value) api_url change the url but make sure the /api/spp_api/1/ is still in the correct place.
  • Then click on Get the list of programs or anything from the list then click Send.

Notes

I'm not sure how or if we can test this with runboat as a private_key.pem and public_key.pub is needed to be stored inside the container's /etc/secrets/ folder.

Related links

#603

@emjay0921 emjay0921 linked an issue Nov 21, 2024 that may be closed by this pull request
3 tasks
@sonarqubecloud
Copy link

@codecov
Copy link

codecov bot commented Nov 21, 2024

Codecov Report

Attention: Patch coverage is 99.44444% with 2 lines in your changes missing coverage. Please review.

Project coverage is 75.98%. Comparing base (fb6cbb1) to head (5657c21).
Report is 11 commits behind head on 17.0.

Files with missing lines Patch % Lines
spp_api/tests/test_spp_api_field_alias.py 93.75% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             17.0     #672      +/-   ##
==========================================
+ Coverage   75.96%   75.98%   +0.02%     
==========================================
  Files         706      705       -1     
  Lines       17927    18059     +132     
  Branches     2223     2218       -5     
==========================================
+ Hits        13618    13723     +105     
- Misses       3851     3872      +21     
- Partials      458      464       +6     

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

@emjay0921 emjay0921 marked this pull request as ready for review November 21, 2024 11:15
Copy link
Member

@gonzalesedwin1123 gonzalesedwin1123 left a comment

Choose a reason for hiding this comment

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

Check the codecov errors

@emjay0921 emjay0921 force-pushed the 603-fix-the-migration-issues branch from 9aac3bb to 14e7523 Compare February 18, 2025 03:34
@sonarqubecloud
Copy link

@gonzalesedwin1123 gonzalesedwin1123 merged commit f5c9f07 into 17.0 Feb 18, 2025
7 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Feb 18, 2025
@gonzalesedwin1123 gonzalesedwin1123 deleted the 603-fix-the-migration-issues branch February 18, 2025 06:45
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.

Fix the migration issues of the SPP API module

4 participants