hazelcast / hazelcast-code-samples

Hazelcast Code Samples
www.hazelcast.org
548 stars 597 forks source link

Migrate Jenkins PR builder to GitHub Action [DI-336] #674

Closed nishaatr closed 2 weeks ago

nishaatr commented 2 weeks ago

This came about at the back of removing Code Samples from Platform releases https://hazelcast.atlassian.net/browse/DI-313

TODO (need help here)

  1. Sort out HZ_LICENSEKEY. We have these in GH so not sure which one to use
    • HAZELCAST_ENTERPRISE_KEY (may be start with this?)
    • HAZELCAST_ENTERPRISE_KEY_V7 (this will future proof perhaps?)
  2. Limit who runs this via the action (checking for org membership) or via the GitHub repo config?
  3. Remove -DskipTests once above is sorted

Fixes: DI-336

JackPGreen commented 2 weeks ago
  1. Sort out HZ_LICENSEKEY. We have these in GH so not sure which one to use

    • HAZELCAST_ENTERPRISE_KEY (may be start with this?)
    • HAZELCAST_ENTERPRISE_KEY_V7 (this will future proof perhaps?)

Ideally V7 unless we need backwards compatibility support - https://hazelcast.slack.com/archives/C01JU7ZJYGP/p1719232648844259

  1. Limit who runs this via the action (checking for org membership) or via the GitHub repo config?

Typically (at least on open-source non-hazelcast repos) this is done via GitHub Repo config, but some Hazelcast repos use hazelcast-tpm/membership.

nishaatr commented 2 weeks ago

Typically (at least on open-source non-hazelcast repos) this is done via GitHub Repo config, but some Hazelcast repos use hazelcast-tpm/membership.

Fixed 967b2d882eae Pls check?

JackPGreen commented 2 weeks ago

Typically (at least on open-source non-hazelcast repos) this is done via GitHub Repo config, but some Hazelcast repos use hazelcast-tpm/membership.

Fixed 967b2d882eae Pls check?

I've not done it personally so I can't say. Could setup a test repo to try it in to be sure?

nishaatr commented 2 weeks ago

I've not done it personally so I can't say. Could setup a test repo to try it in to be sure?

Agreed. Let me try

nishaatr commented 2 weeks ago

We also need to log that the Jenkins build should be disabled.

Mentioned in JIRA already

nishaatr commented 2 weeks ago

Typically (at least on open-source non-hazelcast repos) this is done via GitHub Repo config, but some Hazelcast repos use hazelcast-tpm/membership.

Fixed 967b2d882eae Pls check?

I've not done it personally so I can't say. Could setup a test repo to try it in to be sure?

Removed external author check completely 95e8cc27c and now relying on GH setting which appears to work as intended

image

Tested this in test repo (to be deleted)

INTERNAL: https://github.com/hazelcast/test-pr-builder-nish-tmp/pull/6 EXTERNAL: https://github.com/hazelcast/test-pr-builder-nish-tmp/pull/7

image

nishaatr commented 2 weeks ago

@JackPGreen The Action build failed but Jenkins passed https://jenkins.hazelcast.com/job/hazelcast-code-samples-pr-builder/706/ Could this be down to NOT passing "-Dhazelcast.enterprise.license.key=$HZ_LICENSEKEY" to MVN or may be something else?

I checked 'HAZELCAST_ENTERPRISE_KEY_V7' is open to all repos so can't be that

JackPGreen commented 2 weeks ago

@JackPGreen The Action build failed but Jenkins passed https://jenkins.hazelcast.com/job/hazelcast-code-samples-pr-builder/706/ Could this be down to NOT passing "-Dhazelcast.enterprise.license.key=$HZ_LICENSEKEY" to MVN or may be something else?

I checked 'HAZELCAST_ENTERPRISE_KEY_V7' is open to all repos so can't be that

Yes, it looks like LicenseUtil has it's own behaviour - https://github.com/hazelcast/hazelcast-code-samples/blob/6f418b453ecdb8ff5ec64dce617fe8186deed097/helper/src/main/java/com/hazelcast/examples/helper/LicenseUtils.java#L39