NatLabRockies / NatLabRockies/OpenStudio

RemoteBCL does not enforce min_compatible for measures

Open
#5,230 7 comments 0 reactions 2 assignees View on GitHub

@kflemin is already working on this.

Since Oct 17, 2024.

component - Measure Manager component - Measures severity - Major Bug
Dominant language
C++
Stars
646
Forks
237
Avg merge
3d 11h
Merged PRs (30d)
10

Description

Issue overview

Measures with min_compatible > current CLI version should be be gotten from BCL

Current Behavior

The release of 3.8.0 broke a lot of measures, most notably the openstudio_results measure, because the openstudio-extension-gem's ruby methods were removed from the CLI, and replaced with equivalent C++ methods, but in a non-backward compatible way.

As a result, these measures were adjusted and recently released with new versions that have "min_compatible" = 3.8.0.

RemoteBCL does not check that one bit, neither in searchComponentLibrary + getMeasure nor in measuresWithUpdates.

This is problematic because it means every user of the CLI < 3.8.0 would get the newest version which is not compatible with their current CLI.

https://github.com/NREL/openstudio-common-measures-gem/pull/169#discussion_r1634725319

Expected Behavior

RemoteBCL should check min_compatible/max_compatible.

I would expect that:

  • A measure with min_compatible > current cli version should NOT be in the results
  • A measure with max_compatible < current cli version should NOT be in the results
  • The newest compatible version of a measure should be in the results
    • If a measure has a reivision1 that is compatible with the current CLI, but the revision2 (latest) isn't, revision1 should be suggested

Steps to Reproduce

test_bcl.rb

remoteBCL = OpenStudio::RemoteBCL.new
openstudio_results_uid = "a25386cd-60e4-46bc-8b11-c755f379d916"
responses = remoteBCL.searchMeasureLibrary(openstudio_results_uid, 980)
raise "More than 1 responses" unless responses.size == 1
response = responses.first
if response.respond_to?(:versionModified)
  puts "#{response.name} - versionId=#{response.versionId}, versionModified=#{response.versionModified.get.to_s}"
else
  puts "#{response.name} - versionId=#{response.versionId}"
end
$ /usr/local/openstudio-3.8.0/bin/openstudio test_bcl.rb
Openstudio results - versionId=5b4d387a-f537-4693-a9eb-6192957b6c1b, versionModified=2024-Jul-11 14:31:57
$ /usr/local/openstudio-3.7.0/bin/openstudio test_bcl.rb
Openstudio results - versionId=5b4d387a-f537-4693-a9eb-6192957b6c1b

Possible Solution

Update RemoteBCL code, and expand BCLSearchResult to include min/max compatible. Might need a server change on the BCL side itself.

Details

Environment

Some additional details about your environment for this issue (if relevant):

  • Platform (Operating system, version): all
  • Version of OpenStudio (if using an intermediate build, include SHA): 3.8.0
Context

Found because the OpenStudio Application 1.7.1 which uses OS SDK 3.7.0 has this issue since July 11.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.