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

Versioning_Engine: Add methodology for directly calling upgrades from main process rather than via pipes #3332

Conversation

IsakNaslundBh
Copy link
Contributor

@IsakNaslundBh IsakNaslundBh commented Apr 16, 2024

NOTE: Depends on

BHoM/Versioning_Toolkit#257

Issues addressed by this PR

Closes #3331

Changes the way the BHoMUpgraders are called from running via pipes to instead dynamically loading up the upgraders and directly calling them.

Initial testing shows that this can give a more than 10x speed increase for de-serialising objects requiring versioning, which can be critical for slightly larger serialised files. Increasingly important after changes like the one made in BHoM/BHoM#1579 as that would significantly slow down the de-serialisation of and json file containing Bar objects. This could mean a difference for a file containing a few 100 bars of 10-30 seconds rather than say 3-5 minutes. Hence think this change is fairly critical.

For this PR I opted to make the events raised and calls make mimic the current system as 1:1 as possible. Scope to clean up some of the event raising and similar, but would prefer to leave that to a second PR as this change is big enough.

Also opted to keep the code for the Pipe system, and having a hard-coded boolean as to which system to be used, to make it very simple to switch back to the old system if a problem is discovered without completely reverting this PR. Long term if this works, I think we can get rid of it, and discussed with @adecler , scope to also significantly simplifying the versioning system, leading to a single dll rather than the 1 exe per version we currently work with, but again, for a later PR.

Test files

Tested through as complete as I could think of here

Test by de-serialising all files in https://github.com/BHoM/Versioning_Toolkit/tree/develop/.ci/code/Versioning_Test/Datasets and then serialise them out again, first using the current system on develop (folder called Old in the test folder) and then doing the same again with the new system on this branch. Whilst doing the runs, all events for a particular object is also recorded and stored out.

Every re-serialised json is then compared, ensuring the content contained is the same. Same is done for the events, ensuring the events raised are identical.

For Methods and adapters, no change found.

For obejcts, the only difference found has been properties with BHoM_Guid for some object types. From investigation it seem to be Guids of things like CustomObjects and a like, where a new Guid has been instantiated during the De-serialisation, hence natural that a difference occurs (would be the same as comparing two runs of the old system with each other).

The only other difference found has to do with Items containing "$date" and relating to objects containing Events from 3.3 and before. For this it is related to this commit: BHoM/BHoM@d5998b2 where the date time was added. And object serialised before that will naturally deserialise to include a new DateTime = DateTime.UtcNow which then simply depends on when it was deserialised.

On top of this, ofc Versioning check should be passing. Have also added an example json file and script that can be used to check the speed difference.

Changelog

Additional comments

@IsakNaslundBh
Copy link
Contributor Author

@BHoMBot check versioning

Copy link

bhombot-ci bot commented Apr 18, 2024

@IsakNaslundBh to confirm, the following actions are now queued:

  • check versioning

@IsakNaslundBh
Copy link
Contributor Author

@BHoMBot check compliance

Copy link

bhombot-ci bot commented Apr 18, 2024

@IsakNaslundBh to confirm, the following actions are now queued:

  • check code-compliance
  • check documentation-compliance
  • check project-compliance
  • check branch-compliance
  • check dataset-compliance
  • check copyright-compliance

@IsakNaslundBh
Copy link
Contributor Author

@BHoMBot check compliance

Copy link

bhombot-ci bot commented Apr 23, 2024

@IsakNaslundBh to confirm, the following actions are now queued:

  • check code-compliance
  • check documentation-compliance
  • check project-compliance
  • check branch-compliance
  • check dataset-compliance
  • check copyright-compliance

@IsakNaslundBh
Copy link
Contributor Author

@BHoMBot check versioning

Copy link

bhombot-ci bot commented Apr 23, 2024

@IsakNaslundBh to confirm, the following actions are now queued:

  • check versioning

@IsakNaslundBh
Copy link
Contributor Author

@BHoMBot check installer
@BHoMBot check core
@BHoMBot check serialisation
@BHoMBot check null-handling

Copy link

bhombot-ci bot commented Apr 23, 2024

@IsakNaslundBh to confirm, the following actions are now queued:

  • check installer
  • check core
  • check serialisation
  • check null-handling

There are 2 requests in the queue ahead of you.

Copy link
Member

@pawelbaran pawelbaran left a comment

Choose a reason for hiding this comment

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

Happy to approve the functionality following the test run under direction of @IsakNaslundBh 👍

Copy link
Member

@adecler adecler left a comment

Choose a reason for hiding this comment

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

Happy to approve based on

  • Code inspection
  • Thorough testing by Isak
  • Local check from @pawelbaran

@IsakNaslundBh
Copy link
Contributor Author

@BHoMBot check unit-tests

Copy link

bhombot-ci bot commented Apr 23, 2024

@IsakNaslundBh to confirm, the following actions are now queued:

  • check unit-tests

There are 24 requests in the queue ahead of you.

@IsakNaslundBh IsakNaslundBh force-pushed the Versioning_Engine-#3331-ChangeFromPipeSystemInToNewVersion branch from 2c9ab96 to 01695af Compare April 23, 2024 10:53
@IsakNaslundBh
Copy link
Contributor Author

@BHoMBot check compliance
@BHoMBot check required

Copy link

bhombot-ci bot commented Apr 23, 2024

@IsakNaslundBh to confirm, the following actions are now queued:

  • check code-compliance
  • check documentation-compliance
  • check project-compliance
  • check branch-compliance
  • check dataset-compliance
  • check copyright-compliance
  • check code-compliance
  • check documentation-compliance
  • check project-compliance
  • check core
  • check null-handling
  • check serialisation
  • check versioning
  • check installer

There are 46 requests in the queue ahead of you.

…rsion

Potential scope to improve the behaviour compared to previous version, but for this first system change prefer to make the systems behave literally identical to ensure this switch gives as small impact in terms of functionality as possible.
Copy link

bhombot-ci bot commented Apr 23, 2024

The check code-compliance has already been run previously and recorded as a successful check. This check has not been run again at this time.

Copy link

bhombot-ci bot commented Apr 23, 2024

The check documentation-compliance has already been run previously and recorded as a successful check. This check has not been run again at this time.

@FraserGreenroyd FraserGreenroyd changed the title Add methodology for directly calling upgrades from main process rather than via pipes Versioning_Engine: Add methodology for directly calling upgrades from main process rather than via pipes Apr 23, 2024
@IsakNaslundBh
Copy link
Contributor Author

@BHoMBot check unit-tests

Copy link

bhombot-ci bot commented Apr 23, 2024

@IsakNaslundBh to confirm, the following actions are now queued:

  • check unit-tests

There are 3 requests in the queue ahead of you.

Copy link

bhombot-ci bot commented Apr 23, 2024

FAO: @FraserGreenroyd
@IsakNaslundBh is seeking dispensation on this Pull Request to skip a required check. Please can you provide authorisation for the check to be skipped, or provide assistance as appropriate.

The check they wish to have dispensation on is unit-tests.

If you are providing dispensation on this occasion, please reply with:

@BHoMBot this is a DevOps instruction. I am authorising dispensation to be granted on check ref. 24148984891

@IsakNaslundBh
Copy link
Contributor Author

@BHoMBot this is a DevOps instruction. I am authorising dispensation to be granted on check ref. 24148984891

Copy link

bhombot-ci bot commented Apr 23, 2024

@IsakNaslundBh I have now provided a passing check on reference 24148984891 as requested.

@IsakNaslundBh
Copy link
Contributor Author

@BHoMBot check ready-to-merge

Copy link

bhombot-ci bot commented Apr 23, 2024

@IsakNaslundBh to confirm, the following actions are now queued:

  • check ready-to-merge

There are 2 requests in the queue ahead of you.

@IsakNaslundBh IsakNaslundBh merged commit 2182051 into develop Apr 23, 2024
13 checks passed
@IsakNaslundBh IsakNaslundBh deleted the Versioning_Engine-#3331-ChangeFromPipeSystemInToNewVersion branch April 23, 2024 12:04
@bhombot-ci bhombot-ci bot mentioned this pull request Jun 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:feature New capability or enhancement
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Versioning_Engine: Move away from pipe system in versioning
3 participants