-
Notifications
You must be signed in to change notification settings - Fork 10
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
Refactor d2x.gen and d2x.parse as Pydantic models #44
Merged
jlantz
merged 14 commits into
jlantz/update-auth-structure
from
jlantz/refactor-pydantic-models
Oct 31, 2024
Merged
Refactor d2x.gen and d2x.parse as Pydantic models #44
jlantz
merged 14 commits into
jlantz/update-auth-structure
from
jlantz/refactor-pydantic-models
Oct 31, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Refactor `d2x.gen` and `d2x.parse` functions into Pydantic models and update all callers. * **Add Pydantic Models:** - Add `LoginUrlModel` to `d2x/models/sf/auth.py` to replace `get_login_url_and_token` function. - Add `SfdxAuthUrlModel` to `d2x/models/sf/auth.py` to replace `parse_sfdx_auth_url` function. * **Update Callers:** - Update `d2x/auth/sf/auth_url.py` to use `SfdxAuthUrlModel` for parsing SFDX auth URL. - Update `d2x/auth/sf/login_url.py` to use `LoginUrlModel` for generating login URL. - Update `d2x/cli/main.py` to import `LoginUrlModel` and `SfdxAuthUrlModel`. * **Remove Deprecated Files:** - Delete `d2x/gen/sf/login_url.py`. - Delete `d2x/parse/sf/auth_url.py`. --- For more details, open the [Copilot Workspace session](https://copilot-workspace.githubnext.com/muselab-d2x/d2x/tree/jlantz/update-auth-structure?shareId=XXXX-XXXX-XXXX-XXXX).
* **LoginUrlModel tests** - Test successful instantiation and method call - Test instantiation with missing access token - Test instantiation with missing login URL * **SfdxAuthUrlModel tests** - Test successful instantiation and method call - Test instantiation with invalid URL
* Set `DEMO` to "demo" in the `OrgType` Enum
* Import the `re` module at the top of the file
* Import the `re` module at the top of the file
* Import the `re` module at the top of the file
…empty `ret_url` parameter * Encode `ret_url` parameter as "%2F" if it is empty
* Define a new GitHub Actions workflow for running Python tests * Trigger the workflow on push and pull request events to the main and releases branches * Use the starter workflow for Python tests with Python version 3.10
* Set up Python environment and install dependencies * Run tests and generate coverage report * Upload coverage report to Codecov * Generate and upload test report * Post test summary to GitHub step summary
* Add a reusable workflow for Python tests in `.github/workflows/python-test.yml` * Update branches to include 'main' and 'releases/**' * Remove `branches` section from `pull_request` block * Add a `jobs` section with a `test` job that runs on `ubuntu-latest`
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Refactor
d2x.gen
andd2x.parse
functions into Pydantic models and update all callers.Add Pydantic Models:
LoginUrlModel
tod2x/models/sf/auth.py
to replaceget_login_url_and_token
function.SfdxAuthUrlModel
tod2x/models/sf/auth.py
to replaceparse_sfdx_auth_url
function.Update Callers:
d2x/auth/sf/auth_url.py
to useSfdxAuthUrlModel
for parsing SFDX auth URL.d2x/auth/sf/login_url.py
to useLoginUrlModel
for generating login URL.d2x/cli/main.py
to importLoginUrlModel
andSfdxAuthUrlModel
.Remove Deprecated Files:
d2x/gen/sf/login_url.py
.d2x/parse/sf/auth_url.py
.For more details, open the Copilot Workspace session.