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

Settings_Engine: Add central settings management #3131

Merged
merged 9 commits into from
Aug 8, 2023

Conversation

FraserGreenroyd
Copy link
Contributor

@FraserGreenroyd FraserGreenroyd commented Aug 4, 2023

Issues addressed by this PR

Fixes #2709

Test files

Available here - thanks @peterjamesnugent for the nudge!

Additional comments

Please see this comment for a brief overview of why a new project was added instead of utilising an existing project.

You may also be asking how does this link in with existing BHoM_UI methods on saving and loading settings. BHoM_UI is at a higher dependency level which may prohibit toolkits (such as Revit_Toolkit) from accessing them. Tools within the ZeroCodeTool Space along the BIM spectrum may also encounter issues. Thus, this is designed to be a central settings management system, accessible to any level of BHoM beneath it and not restricted just to the UI levels. What this means for the existing UI functionality is that, in separate issues of narrow scope, that functionality will be ported over from BHoM_UI into here, and BHoM_UI will call these methods to handle loading settings into UI elements. That's the plan at any rate.

The script in the folder for testing goes through the methods/workflows this PR adds and nothing more. There is also a test settings JSON file within the folder to use as well if you don't have one of your own. The test script does assume that you don't already have a LibrarySettings object serialised within the folder you're loading from - if you do you might find the return default object test doesn't work in the script - but feel free to test with another object as appropriate. The test script is a guide after all and not a definitive.

I don't think the methods added should be extension methods and thus do not agree with the code-compliance failure the bot is reporting, but happy to debate depending on what others think.

@FraserGreenroyd
Copy link
Contributor Author

FraserGreenroyd commented Aug 4, 2023

@BHoMBot check project-compliance

@bhombot-ci
Copy link

bhombot-ci bot commented Aug 4, 2023

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

  • check project-compliance

@bhombot-ci
Copy link

bhombot-ci bot commented Aug 4, 2023

@FraserGreenroyd fix requested for project compliance.

The errors with the CSProject (.csproj) files have been recorded as annotations on the checks tab.

I will apply the fixes to every case detailed on the checks tab with the exception of any references to the target framework. I am unable to provide fixes to the Target Framework automatically, these will need to be performed manually. If you want to perform the fixes in a different manner please resolve this manually and rerun the check.

If you are happy for me to go ahead and perform this action, please reply with:

@BHoMBot fix project file ref. 15620170822

@FraserGreenroyd
Copy link
Contributor Author

@BHoMBot fix project file ref. 15620170822

@bhombot-ci
Copy link

bhombot-ci bot commented Aug 4, 2023

@FraserGreenroyd I have queued up your request to fix the csproj file(s). There are 0 requests in the queue ahead of you.

@bhombot-ci
Copy link

bhombot-ci bot commented Aug 4, 2023

@FraserGreenroyd I am now going to fix the project compliance in accordance with the annotations previously made.

@bhombot-ci
Copy link

bhombot-ci bot commented Aug 4, 2023

@FraserGreenroyd to confirm I have now resolved the project compliance issues and pushed a commit to this Pull Request.

@FraserGreenroyd
Copy link
Contributor Author

@BHoMBot check copyright-compliance

@bhombot-ci
Copy link

bhombot-ci bot commented Aug 4, 2023

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

  • check copyright-compliance

@bhombot-ci
Copy link

bhombot-ci bot commented Aug 4, 2023

@FraserGreenroyd fix requested for copyright headers.

The errors with the copyright headers on the CS (.cs) files have been recorded as annotations on the checks tab.

I will apply the fixes to every case detailed on the checks tab. If you want to perform the fixes in a different manner please resolve this manually and rerun the check.

Each CS (.cs) file that does not have the current copyright header will have it applied. The current copyright header can be examined here.

If you are happy for me to go ahead and perform this action, please reply with:

@BHoMBot fix copyright headers ref. 15620213842

@FraserGreenroyd
Copy link
Contributor Author

@BHoMBot fix copyright headers ref. 15620213842

@bhombot-ci
Copy link

bhombot-ci bot commented Aug 4, 2023

@FraserGreenroyd I have queued up your request to fix copyright headers. There are 0 requests in the queue ahead of you.

@bhombot-ci
Copy link

bhombot-ci bot commented Aug 4, 2023

@FraserGreenroyd I am now going to fix the copyright compliance in accordance with the annotations previously made.

@bhombot-ci
Copy link

bhombot-ci bot commented Aug 4, 2023

@FraserGreenroyd to confirm I have now resolved the copyright compliance and pushed a commit to this Pull Request.

@FraserGreenroyd
Copy link
Contributor Author

@BHoMBot check compliance

@bhombot-ci
Copy link

bhombot-ci bot commented Aug 4, 2023

@FraserGreenroyd 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

Copy link
Member

@peterjamesnugent peterjamesnugent left a comment

Choose a reason for hiding this comment

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

Apart from the CreateInstance comment below it all works as intended. It only seems to be initially, if I delete everything from the C:\ProgramData\BHoM\Settings it works fine.

We just need to make sure it works straight away for users and they don't have to fiddle with file types.

Slightly annoying when loading settings from the non-default folder and then saving it to default, but I guess that's on the user to connect the wires as there's no easy way for the SaveSettings to know of the inputs from LoadSettings.

Copy link
Member

@peterjamesnugent peterjamesnugent left a comment

Choose a reason for hiding this comment

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

Checked the changes made in relation to ToolkitSettings that did not allow a parameterless construction and happy that the issue is resolved.

@FraserGreenroyd
Copy link
Contributor Author

@BHoMBot check compliance
@BHoMBot check required

@bhombot-ci
Copy link

bhombot-ci bot commented Aug 8, 2023

@FraserGreenroyd 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

@bhombot-ci
Copy link

bhombot-ci bot commented Aug 8, 2023

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

@bhombot-ci
Copy link

bhombot-ci bot commented Aug 8, 2023

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.

@bhombot-ci
Copy link

bhombot-ci bot commented Aug 8, 2023

FAO: @FraserGreenroyd
@FraserGreenroyd 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 code-compliance.

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. 15717048464

@FraserGreenroyd
Copy link
Contributor Author

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

@bhombot-ci
Copy link

bhombot-ci bot commented Aug 8, 2023

@FraserGreenroyd I have now provided a passing check on reference 15717048464 as requested.

@FraserGreenroyd
Copy link
Contributor Author

@BHoMBot this is a DevOps instruction. I am requesting neutral checks on: versioning, unit-tests, ready-to-merge

@bhombot-ci
Copy link

bhombot-ci bot commented Aug 8, 2023

@FraserGreenroyd I have provided neutral checks to the checks requested. These checks will need to be run properly to obtain full results.

@FraserGreenroyd FraserGreenroyd merged commit aaeed41 into develop Aug 8, 2023
@FraserGreenroyd FraserGreenroyd deleted the BHoM_Engine-#2709-Settings branch August 8, 2023 16:25
@bhombot-ci bhombot-ci bot mentioned this pull request Sep 11, 2023
@bhombot-ci bhombot-ci bot mentioned this pull request Dec 11, 2023
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.

Shall we consider setting up a framework for settings management?
3 participants