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

[CI][Build] Use BUILD_NUMBER for building bundles #1371

Merged
merged 1 commit into from
Mar 24, 2022

Conversation

kavilla
Copy link
Member

@kavilla kavilla commented Mar 23, 2022

Description

When running a release build for example:

yarn build-platform --linux --skip-os-packages --release

The build task runs through get_build_number and
checks how many commits you have locally and determines the
build number. From there, and this is the value that
is used to as a cache busting mechanism.

However, in the release build repo
https://github.com/opensearch-project/opensearch-build

When this gets packaged and verified it actually pulls
from the specified branch and only retrieves the HEAD
commit. Thus making the count of commits locally equal
to 1 and get_build_number always return 1 for releases
essentially breaking the cache buster.

The build repo however, sets an env variable of BUILD_NUMBER
so if this value is available it will use it instead of commit
count.

Signed-off-by: Kawika Avilla [email protected]

Issues Resolved

Check List

  • New functionality includes testing.
    • All tests pass
      • yarn test:jest
      • yarn test:jest_integration
      • yarn test:ftr
  • New functionality has been documented.
  • Commits are signed per the DCO using --signoff

@kavilla kavilla requested a review from a team as a code owner March 23, 2022 08:59
When running a release build for example:

```
yarn build-platform --linux --skip-os-packages --release
```

The build task runs through get_build_number and
checks how many commits you have locally and determines the
build number. From there, and this is the value that
is used to as a cache busting mechanism.

However, in the release build repo
https://github.com/opensearch-project/opensearch-build

When this gets packaged and verified it actually pulls
from the specified branch and only retrieves the HEAD
commit. Thus making the count of commits locally equal
to `1` and get_build_number always return `1` for releases
essentially breaking the cache buster.

The build repo however, sets an env variable of `BUILD_NUMBER`
so if this value is available it will use it instead of commit
count.

The CI runs the unit tests and only gets the latest commit as well
so instead of setting a env build number and basically creating
the same unit test only check this locally.

Issues resolved:
* opensearch-project/opensearch-build#1769
* opensearch-project#1363

Signed-off-by: Kawika Avilla <[email protected]>
@kavilla kavilla force-pushed the avillk/envBuildNum branch from dffab91 to d734d13 Compare March 23, 2022 18:43
@kavilla kavilla linked an issue Mar 23, 2022 that may be closed by this pull request
@kavilla kavilla requested review from tmarkley, ananzh and boktorbb March 23, 2022 22:26
Copy link
Member

@ananzh ananzh left a comment

Choose a reason for hiding this comment

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

LGTM

@kavilla kavilla merged commit 797d988 into opensearch-project:main Mar 24, 2022
@kavilla kavilla deleted the avillk/envBuildNum branch March 24, 2022 17:20
opensearch-trigger-bot bot pushed a commit that referenced this pull request Mar 24, 2022
When running a release build for example:

```
yarn build-platform --linux --skip-os-packages --release
```

The build task runs through get_build_number and
checks how many commits you have locally and determines the
build number. From there, and this is the value that
is used to as a cache busting mechanism.

However, in the release build repo
https://github.com/opensearch-project/opensearch-build

When this gets packaged and verified it actually pulls
from the specified branch and only retrieves the HEAD
commit. Thus making the count of commits locally equal
to `1` and get_build_number always return `1` for releases
essentially breaking the cache buster.

The build repo however, sets an env variable of `BUILD_NUMBER`
so if this value is available it will use it instead of commit
count.

The CI runs the unit tests and only gets the latest commit as well
so instead of setting a env build number and basically creating
the same unit test only check this locally.

Issues resolved:
* opensearch-project/opensearch-build#1769
* #1363

Signed-off-by: Kawika Avilla <[email protected]>
(cherry picked from commit 797d988)
kavilla added a commit that referenced this pull request Mar 24, 2022
When running a release build for example:

```
yarn build-platform --linux --skip-os-packages --release
```

The build task runs through get_build_number and
checks how many commits you have locally and determines the
build number. From there, and this is the value that
is used to as a cache busting mechanism.

However, in the release build repo
https://github.com/opensearch-project/opensearch-build

When this gets packaged and verified it actually pulls
from the specified branch and only retrieves the HEAD
commit. Thus making the count of commits locally equal
to `1` and get_build_number always return `1` for releases
essentially breaking the cache buster.

The build repo however, sets an env variable of `BUILD_NUMBER`
so if this value is available it will use it instead of commit
count.

The CI runs the unit tests and only gets the latest commit as well
so instead of setting a env build number and basically creating
the same unit test only check this locally.

Issues resolved:
* opensearch-project/opensearch-build#1769
* #1363

Signed-off-by: Kawika Avilla <[email protected]>
(cherry picked from commit 797d988)

Co-authored-by: Kawika Avilla <[email protected]>
opensearch-trigger-bot bot pushed a commit that referenced this pull request Mar 30, 2022
When running a release build for example:

```
yarn build-platform --linux --skip-os-packages --release
```

The build task runs through get_build_number and
checks how many commits you have locally and determines the
build number. From there, and this is the value that
is used to as a cache busting mechanism.

However, in the release build repo
https://github.com/opensearch-project/opensearch-build

When this gets packaged and verified it actually pulls
from the specified branch and only retrieves the HEAD
commit. Thus making the count of commits locally equal
to `1` and get_build_number always return `1` for releases
essentially breaking the cache buster.

The build repo however, sets an env variable of `BUILD_NUMBER`
so if this value is available it will use it instead of commit
count.

The CI runs the unit tests and only gets the latest commit as well
so instead of setting a env build number and basically creating
the same unit test only check this locally.

Issues resolved:
* opensearch-project/opensearch-build#1769
* #1363

Signed-off-by: Kawika Avilla <[email protected]>
(cherry picked from commit 797d988)
kavilla added a commit that referenced this pull request Mar 31, 2022
When running a release build for example:

```
yarn build-platform --linux --skip-os-packages --release
```

The build task runs through get_build_number and
checks how many commits you have locally and determines the
build number. From there, and this is the value that
is used to as a cache busting mechanism.

However, in the release build repo
https://github.com/opensearch-project/opensearch-build

When this gets packaged and verified it actually pulls
from the specified branch and only retrieves the HEAD
commit. Thus making the count of commits locally equal
to `1` and get_build_number always return `1` for releases
essentially breaking the cache buster.

The build repo however, sets an env variable of `BUILD_NUMBER`
so if this value is available it will use it instead of commit
count.

The CI runs the unit tests and only gets the latest commit as well
so instead of setting a env build number and basically creating
the same unit test only check this locally.

Issues resolved:
* opensearch-project/opensearch-build#1769
* #1363

Signed-off-by: Kawika Avilla <[email protected]>
(cherry picked from commit 797d988)

Co-authored-by: Kawika Avilla <[email protected]>
opensearch-trigger-bot bot pushed a commit that referenced this pull request Apr 14, 2022
When running a release build for example:

```
yarn build-platform --linux --skip-os-packages --release
```

The build task runs through get_build_number and
checks how many commits you have locally and determines the
build number. From there, and this is the value that
is used to as a cache busting mechanism.

However, in the release build repo
https://github.com/opensearch-project/opensearch-build

When this gets packaged and verified it actually pulls
from the specified branch and only retrieves the HEAD
commit. Thus making the count of commits locally equal
to `1` and get_build_number always return `1` for releases
essentially breaking the cache buster.

The build repo however, sets an env variable of `BUILD_NUMBER`
so if this value is available it will use it instead of commit
count.

The CI runs the unit tests and only gets the latest commit as well
so instead of setting a env build number and basically creating
the same unit test only check this locally.

Issues resolved:
* opensearch-project/opensearch-build#1769
* #1363

Signed-off-by: Kawika Avilla <[email protected]>
(cherry picked from commit 797d988)
opensearch-trigger-bot bot pushed a commit that referenced this pull request Apr 14, 2022
When running a release build for example:

```
yarn build-platform --linux --skip-os-packages --release
```

The build task runs through get_build_number and
checks how many commits you have locally and determines the
build number. From there, and this is the value that
is used to as a cache busting mechanism.

However, in the release build repo
https://github.com/opensearch-project/opensearch-build

When this gets packaged and verified it actually pulls
from the specified branch and only retrieves the HEAD
commit. Thus making the count of commits locally equal
to `1` and get_build_number always return `1` for releases
essentially breaking the cache buster.

The build repo however, sets an env variable of `BUILD_NUMBER`
so if this value is available it will use it instead of commit
count.

The CI runs the unit tests and only gets the latest commit as well
so instead of setting a env build number and basically creating
the same unit test only check this locally.

Issues resolved:
* opensearch-project/opensearch-build#1769
* #1363

Signed-off-by: Kawika Avilla <[email protected]>
(cherry picked from commit 797d988)
opensearch-trigger-bot bot pushed a commit that referenced this pull request Apr 14, 2022
When running a release build for example:

```
yarn build-platform --linux --skip-os-packages --release
```

The build task runs through get_build_number and
checks how many commits you have locally and determines the
build number. From there, and this is the value that
is used to as a cache busting mechanism.

However, in the release build repo
https://github.com/opensearch-project/opensearch-build

When this gets packaged and verified it actually pulls
from the specified branch and only retrieves the HEAD
commit. Thus making the count of commits locally equal
to `1` and get_build_number always return `1` for releases
essentially breaking the cache buster.

The build repo however, sets an env variable of `BUILD_NUMBER`
so if this value is available it will use it instead of commit
count.

The CI runs the unit tests and only gets the latest commit as well
so instead of setting a env build number and basically creating
the same unit test only check this locally.

Issues resolved:
* opensearch-project/opensearch-build#1769
* #1363

Signed-off-by: Kawika Avilla <[email protected]>
(cherry picked from commit 797d988)
kavilla added a commit that referenced this pull request Apr 25, 2022
When running a release build for example:

```
yarn build-platform --linux --skip-os-packages --release
```

The build task runs through get_build_number and
checks how many commits you have locally and determines the
build number. From there, and this is the value that
is used to as a cache busting mechanism.

However, in the release build repo
https://github.com/opensearch-project/opensearch-build

When this gets packaged and verified it actually pulls
from the specified branch and only retrieves the HEAD
commit. Thus making the count of commits locally equal
to `1` and get_build_number always return `1` for releases
essentially breaking the cache buster.

The build repo however, sets an env variable of `BUILD_NUMBER`
so if this value is available it will use it instead of commit
count.

The CI runs the unit tests and only gets the latest commit as well
so instead of setting a env build number and basically creating
the same unit test only check this locally.

Issues resolved:
* opensearch-project/opensearch-build#1769
* #1363

Signed-off-by: Kawika Avilla <[email protected]>
(cherry picked from commit 797d988)

Co-authored-by: Kawika Avilla <[email protected]>
kavilla added a commit that referenced this pull request Apr 25, 2022
When running a release build for example:

```
yarn build-platform --linux --skip-os-packages --release
```

The build task runs through get_build_number and
checks how many commits you have locally and determines the
build number. From there, and this is the value that
is used to as a cache busting mechanism.

However, in the release build repo
https://github.com/opensearch-project/opensearch-build

When this gets packaged and verified it actually pulls
from the specified branch and only retrieves the HEAD
commit. Thus making the count of commits locally equal
to `1` and get_build_number always return `1` for releases
essentially breaking the cache buster.

The build repo however, sets an env variable of `BUILD_NUMBER`
so if this value is available it will use it instead of commit
count.

The CI runs the unit tests and only gets the latest commit as well
so instead of setting a env build number and basically creating
the same unit test only check this locally.

Issues resolved:
* opensearch-project/opensearch-build#1769
* #1363

Signed-off-by: Kawika Avilla <[email protected]>
(cherry picked from commit 797d988)

Co-authored-by: Kawika Avilla <[email protected]>
kavilla added a commit that referenced this pull request Apr 25, 2022
When running a release build for example:

```
yarn build-platform --linux --skip-os-packages --release
```

The build task runs through get_build_number and
checks how many commits you have locally and determines the
build number. From there, and this is the value that
is used to as a cache busting mechanism.

However, in the release build repo
https://github.com/opensearch-project/opensearch-build

When this gets packaged and verified it actually pulls
from the specified branch and only retrieves the HEAD
commit. Thus making the count of commits locally equal
to `1` and get_build_number always return `1` for releases
essentially breaking the cache buster.

The build repo however, sets an env variable of `BUILD_NUMBER`
so if this value is available it will use it instead of commit
count.

The CI runs the unit tests and only gets the latest commit as well
so instead of setting a env build number and basically creating
the same unit test only check this locally.

Issues resolved:
* opensearch-project/opensearch-build#1769
* #1363

Signed-off-by: Kawika Avilla <[email protected]>
(cherry picked from commit 797d988)

Co-authored-by: Kawika Avilla <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Cache buster broken for releases
4 participants