Skip to content

Steps to register a new version of the REopt package

adfarth edited this page Jun 13, 2024 · 16 revisions

Steps for REopt.jl

  • Branch off of REopt.jl develop to make a feature_branch and add features/changes
  • Ensure the REopt.jl help text/doc strings are updated and descriptive of model behavior. Add any new files to REopt.jl/docs. Writing up documentation and the tests can help inform development.
  • Ensure you include tests of new features/changes
  • Open PR: develop <- [feature_branch]
    • Have at least one reviewer approve the PR. Delete the feature_branch once it's been merged into develop
  • Open PR: master <- develop. Put the new version # (following Semantic Versioning rules) in the name of the PR. In the description, link to the relevant (and now closed) PR(s) of develop <- [feature branch].
    • Update the develop branch CHANGELOG.md with changes. Use new REopt version # as the header.
    • Important! Change the REopt version # manually in Project.toml
    • If you've added a new dependency, the Julia Pkg manager won’t manually update the [compat] section of Project.toml (you will see the new dependency under [deps] but not [compat]). You must manually update [compat] with packages and version #(s). See guidance here.
  • Once merged into master, go to repo landing page → go to last merge commit → comment at bottom: @JuliaRegistrator register. 
  • Go to Releases → Draft new release
    • Tag = version #
    • Target = master
    • Summary can be from the Changelog (or can use "Generate release notes" functionality); title can be same as PR title
    • This creates a GitHub tag; doesn’t affect Julia pkg version (the @JuliaRegistrator register command does this)
  • Important Note: The REopt_API calls a specified version of this REopt.jl package (see here), typically the officially-registered version. If you change or add inputs or outputs to REopt.jl, you'll need to update/add the linkages between the REopt_API and REopt.jl before updating the REopt.jl version used by the API. (See steps below)

Steps for REopt_API

  • Branch off of REopt_API develop to make a feature_branch. Add or modify any inputs or outputs to align with the newly registered version of REopt.jl (see steps above).

  • Create a draft PR for develop <- [feature_branch] (so that you can use GitHub's Actions to run tests).

  • Update the REopt.jl version (or branch, for testing) from within the Docker environment in the julia_src/ directory:

    • docker compose up
    • In the Docker plugin in VSCode or Docker Desktop: attach shell to the julia_api container. (If in VSCode, click the whale, right click the "julia_api" container and click "Attach Shell")
    • Spin up Julia and activate this directory: julia --project=.
    • Open package manager with ]
    • Do one of the following:
      • pkg> update REopt to update the version called by the API to the officially registered version.
      • pkg> add REopt#branchname to point to your dev branch for testing, but ensure you "update REopt" prior to merging into develop.
      • pkg> update to reset any changes you may have accidentally made to the Manifest.
    • Make sure your updates don't break any tests by pushing a commit to your Pull Request (will test in the highs environ) and running the reoptjl.test.test_job_endpoint and reoptjl.test.test_http_endpoints files.
  • If any inputs or outputs are modified, make sure to make database migrations (python manage.py makemigrations, python manage.py migrate).

  • Think about web tool updates related to your branch: Did you change defaults, input or output names, or endpoints?, Do you need to update tooltips for inputs or outputs?, Do you need to update input or output fields?

  • If all tests pass and PR is approved, merge develop <- [feature_branch] and deploy the develop branch to the development server to make sure it doesn't break deployment and for UI testing.

  • Create a PR for master <- develop

    • Update CHANGELOG with changes, make the header the new REopt_API version (this is distinct from the REopt.jl version)
  • Once merged, publish a new release of the API with a description of the changes.

  • Deploy master to the development and staging servers

  • Ensure any changes to defaults are also reflected in the web tool, and deployed at the same time as the API deploy

Additional Checklist