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

IFC-727 calculate diff tree in proposed change pipeline #4546

Merged
merged 9 commits into from
Oct 8, 2024

Conversation

ajtmccarty
Copy link
Contributor

IFC-727
sdk PR opsmill/infrahub-sdk-python#61

  • remove unit test that belongs in SDK
  • add diff calculation to the proposed change pipeline

@github-actions github-actions bot added the group/backend Issue related to the backend (API Server, Git Agent) label Oct 5, 2024
Copy link

codspeed-hq bot commented Oct 5, 2024

CodSpeed Performance Report

Merging #4546 will not alter performance

Comparing ajtm-10052024-diff-in-pipeline-IFC-727 (e9b34ed) with stable (bf8e85e)

Summary

✅ 10 untouched benchmarks

@ajtmccarty ajtmccarty marked this pull request as ready for review October 6, 2024 17:52
@ajtmccarty ajtmccarty requested a review from a team October 6, 2024 17:52
Copy link
Contributor

@ogenstad ogenstad left a comment

Choose a reason for hiding this comment

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

I think the changes looks solid. What I don't really like is that we don't get to see that the changes will work in combination. As the Git submodule still points to a commit that doesn't include the changes you made in the SDK we wouldn't spot any errors at this point of there was anything that is wrong and it will be harder to understand why something starts to fail later.

I'm not sure how we should handle this in general.

One way would be to;

  1. update the submodule commit in this PR to be that of your SDK branch in order to verify that it is working
  2. merge the PR in the SDK
  3. go back to this PR, either change the submodule to the current stable commit or leave it

What are your thoughts around that?

component_registry = get_component_registry()
async with service.database.start_transaction() as dbt:
diff_coordinator = await component_registry.get_component(DiffCoordinator, db=dbt, branch=source_branch)
await diff_coordinator.update_branch_diff(base_branch=destination_branch, diff_branch=source_branch)
Copy link
Contributor

Choose a reason for hiding this comment

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

This would only update the branch diff and not in any way give us access to the diff_summary right? I'm thinking that we first do some operations directly against the database and then as the next step we use the SDK to query for the changes (which I guess would be what we updated but also what might have been updated earlier)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

the DiffTree and DiffTreeSummary graphql queries get their data from the same place. Running update_branch_diff here will create/update that data so that both queries can be used and will be up-to-date (for the moment, at least. other stuff that runs in the pipeline can make changes that will require another update to the diff

@ajtmccarty ajtmccarty force-pushed the ajtm-10052024-diff-in-pipeline-IFC-727 branch from a4e2d92 to e08d7b5 Compare October 7, 2024 18:06
@github-actions github-actions bot added type/documentation Improvements or additions to documentation group/frontend Issue related to the frontend (React) group/ci Issue related to the CI pipeline labels Oct 7, 2024
@ajtmccarty
Copy link
Contributor Author

I updated the python_sdk commit in this PR to point to the commit on the partner PR in the sdk repo opsmill/infrahub-sdk-python#61
when both are approved, I will merge the sdk PR, update the commit pointer on this PR to the latest sdk commit on stable, then merge this PR

@ajtmccarty ajtmccarty force-pushed the ajtm-10052024-diff-in-pipeline-IFC-727 branch from e08d7b5 to 91760ab Compare October 7, 2024 20:41
@github-actions github-actions bot removed type/documentation Improvements or additions to documentation group/frontend Issue related to the frontend (React) group/ci Issue related to the CI pipeline labels Oct 7, 2024
@github-actions github-actions bot added the type/documentation Improvements or additions to documentation label Oct 7, 2024
Copy link
Contributor

@ogenstad ogenstad left a comment

Choose a reason for hiding this comment

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

LGTM. Not sure what the commit for the SDK if that should be replaced with the latest "stable" one if this is another one.

@ajtmccarty ajtmccarty merged commit 38458d2 into stable Oct 8, 2024
31 checks passed
@ajtmccarty ajtmccarty deleted the ajtm-10052024-diff-in-pipeline-IFC-727 branch October 8, 2024 17:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
group/backend Issue related to the backend (API Server, Git Agent) type/documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants