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

#10531 - Use non-deprecated Github Actions #10532

Merged
merged 5 commits into from
Jun 3, 2024

Conversation

jmarrec
Copy link
Contributor

@jmarrec jmarrec commented May 28, 2024

Pull request overview

Pull Request Author

Add to this list or remove from it as applicable. This is a simple templated set of guidelines.

  • Title of PR should be user-synopsis style (clearly understandable in a standalone changelog context)
  • Label the PR with at least one of: Defect, Refactoring, NewFeature, Performance, and/or DoNoPublish
  • Pull requests that impact EnergyPlus code must also include unit tests to cover enhancement or defect repair
  • Author should provide a "walkthrough" of relevant code changes using a GitHub code review comment process
  • If any diffs are expected, author must demonstrate they are justified using plots and descriptions
  • If changes fix a defect, the fix should be demonstrated in plots and descriptions
  • If any defect files are updated to a more recent version, upload new versions here or on DevSupport
  • If IDD requires transition, transition source, rules, ExpandObjects, and IDFs must be updated, and add IDDChange label
  • If structural output changes, add to output rules file and add OutputChange label
  • If adding/removing any LaTeX docs or figures, update that document's CMakeLists file dependencies

Reviewer

This will not be exhaustively relevant to every PR.

  • Perform a Code Review on GitHub
  • If branch is behind develop, merge develop and build locally to check for side effects of the merge
  • If defect, verify by running develop branch and reproducing defect, then running PR and reproducing fix
  • If feature, test running new feature, try creative ways to break it
  • CI status: all green or justified
  • Check that performance is not impacted (CI Linux results include performance check)
  • Run Unit Test(s) locally
  • Check any new function arguments for performance impacts
  • Verify IDF naming conventions and styles, memos and notes and defaults
  • If new idf included, locally check the err file and other outputs

@jmarrec jmarrec added Defect Includes code to repair a defect in EnergyPlus Developer Issue Related to cmake, packaging, installers, or developer tooling (CI, etc) labels May 28, 2024
@jmarrec jmarrec self-assigned this May 28, 2024
Comment on lines +1 to +8
version: 2
updates:

- package-ecosystem: "github-actions"
directory: "/"
schedule:
# Check for updates to GitHub Actions every week
interval: "weekly"
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This might need tweaking to be less annoying (filtering on semver:major only maybe), we'll see. I'll do it as needed.

Copy link
Member

Choose a reason for hiding this comment

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

Filtering to semver:major does seem pretty reasonable. But also...maybe weekly isn't too bad regardless. Is there a dependabot or whatever that can open PRs automatically to take the weekly pain down a bit?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Comment on lines +77 to +80
if __name__ == "__main__":
parser = argparse.ArgumentParser(description="Update GHA Actions.")
parser.add_argument("--safe", action="store_true", default=False, help="Only update official GHA actions/xxx")
args = parser.parse_args()
Copy link
Contributor Author

Choose a reason for hiding this comment

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

New script to run locally to automatically update GHA actions

If you pass "--safe" it will only check the actions that start with "actions/xxx" meaning they are official github actions. Compatibility is pretty much a given here from experience. (actions/checkout, actions/setup-python, actions/upload-artifact, etc)

- name: Run clang-format style check for C/C++ programs.
uses: jidicula/clang-format-action@v4.10.1
uses: jidicula/clang-format-action@v4.13.0
Copy link
Contributor Author

Choose a reason for hiding this comment

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

One of two deps that aren't github official that I bumped

Copy link
Member

Choose a reason for hiding this comment

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

Sounds good. Same question about using the full SHA for resilience/safety? Probably not important, just asking.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is a "community" maintained action, so pinning to a minor/patch isn't a bad idea.

@@ -9,7 +9,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Verify PR label action
uses: mheap/github-action-required-labels@v3
uses: mheap/github-action-required-labels@v5
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Other of two deps that aren't github official that I bumped

@jmarrec jmarrec requested a review from Myoldmopar May 29, 2024 22:16
Copy link
Member

@Myoldmopar Myoldmopar left a comment

Choose a reason for hiding this comment

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

No problem at all with this, it's a great improvement. And adding a weekly check plus a locally running script to auto-update them is very nice.

One question I have is...what if we want to pin to a specific version for a while? This will continually complain? Is there 'exclude-list' capability?

In any case, this should merge right away.

@@ -21,7 +21,7 @@ jobs:
runs-on: ubuntu-latest
steps:
# check out the repo to get the script downloaded
- uses: actions/checkout@v3
- uses: actions/checkout@v4
Copy link
Member

Choose a reason for hiding this comment

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

This is good, of course. Any preference to using the full SHA instead of a tag? Is that safer/preferred?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Github official actions are safe to pin to a major tag.

- name: Run clang-format style check for C/C++ programs.
uses: jidicula/clang-format-action@v4.10.1
uses: jidicula/clang-format-action@v4.13.0
Copy link
Member

Choose a reason for hiding this comment

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

Sounds good. Same question about using the full SHA for resilience/safety? Probably not important, just asking.

Comment on lines +1 to +8
version: 2
updates:

- package-ecosystem: "github-actions"
directory: "/"
schedule:
# Check for updates to GitHub Actions every week
interval: "weekly"
Copy link
Member

Choose a reason for hiding this comment

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

Filtering to semver:major does seem pretty reasonable. But also...maybe weekly isn't too bad regardless. Is there a dependabot or whatever that can open PRs automatically to take the weekly pain down a bit?

@Myoldmopar
Copy link
Member

Totally happy. No reason to hold. We can continue to tweak this along with everything else at any time. Thanks @jmarrec

@Myoldmopar Myoldmopar merged commit b502279 into develop Jun 3, 2024
10 checks passed
@Myoldmopar Myoldmopar deleted the 10531_Deprecated_GHAActions branch June 3, 2024 16:34
@jmarrec
Copy link
Contributor Author

jmarrec commented Jun 5, 2024

One question I have is...what if we want to pin to a specific version for a while? This will continually complain? Is there 'exclude-list' capability?

exactly. It's called "ignore", see https://docs.github.com/en/code-security/dependabot/dependabot-version-updates/configuring-dependabot-version-updates#example-disabling-version-updates-for-some-dependencies

eg

    ignore:
      # Ignore updates to packages that start with 'aws'
      # Wildcards match zero or more arbitrary characters
      - dependency-name: "aws*"
      # Ignore some updates to the 'express' package
      - dependency-name: "express"
        # Ignore only new versions for 4.x and 5.x
        versions: ["4.x", "5.x"]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Defect Includes code to repair a defect in EnergyPlus Developer Issue Related to cmake, packaging, installers, or developer tooling (CI, etc)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Using deprecated Github Actions
6 participants