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: fix build-tools installation in GH actions workflow #21556

Merged
merged 3 commits into from
Jun 20, 2024

Conversation

tylerbutler
Copy link
Member

@tylerbutler tylerbutler commented Jun 20, 2024

The push-tag-create-release workflow creates GitHub releases when release tags are pushed to the repo. This automates the creation of the GH release. Without this change, the workflow fails, and GH releases are not created.

In #20972, build-cli (flub) was updated to ESM. Prior to that change, we had a hacky flub shim in the bin folder, alongside the files that oclif uses (and what's in the bin folder). We did that so we could add the path to build-cli/bin to the PATH, and then flub commands would work. This enabled us to use flub commands directly in CI scripts just like one would do locally.

That shim was removed with the change to ESM, and we instead use npm link to make flub available on the PATH. The shim was likely never really needed; we could have used this approach the whole time.

Tested with act:

act push -W .github/workflows/push-tag-create-release.yml -v

AB#8474

@github-actions github-actions bot added area: build Build related issues base: main PRs targeted against main branch labels Jun 20, 2024
@tylerbutler tylerbutler enabled auto-merge (squash) June 20, 2024 18:24
@CraigMacomber
Copy link
Contributor

CraigMacomber commented Jun 20, 2024

Its unclear to me what the exact change is that causes us to need this change. It seems like moving build-tools to ESM removed something from its /bin that we need, but its still in some bin folder that npm link exposes? What file no longer exists and what was it replaced by? Is there a reason not to just use a path to the new file? Is there a reason the new bin is not in the same bin folder? There is no lib or dist in the path, just /bin, so I don't think that's the issue. There arn't enough details in the change itself or the PR description to answer these kinds of questions which makes it hard for me to review this with what little context I have.

@tylerbutler
Copy link
Member Author

Its unclear to me what the exact change is that causes us to need this change. It seems like moving build-tools to ESM removed something from its /bin that we need, but its still in some bin folder that npm link exposes? What file no longer exists and what was it replaced by? Is there a reason not to just use a path to the new file? Is there a reason the new bin is not in the same bin folder? There is no lib or dist in the path, just /bin, so I don't think that's the issue. There arn't enough details in the change itself or the PR description to answer these kinds of questions which makes it hard for me to review this with what little context I have.

I added some more detail to the PR description. I think the reason the hacky shim ever existed was because I couldn't find a way at the time to make it work without it. I wanted to make sure that the commands used in CI scripts used flub instead of something like bin/run.js.

Knowing what I know now, all of that was unnecessary with proper use of npm link (pnpm link doesn't work - haven't investigated more deeply).

@tylerbutler tylerbutler requested a review from a team June 20, 2024 21:37
@tylerbutler tylerbutler merged commit 73e479f into microsoft:main Jun 20, 2024
32 checks passed
@tylerbutler tylerbutler deleted the fix-gh-releasse-workflow branch June 20, 2024 22:56
tylerbutler added a commit to tylerbutler/FluidFramework that referenced this pull request Jun 22, 2024
)

This workflow was not updated after build-tools was updated to ESM
instead of CJS. The fix is to use `npm link` to make `flub` available
since the old shim was removed when we switched to ESM.

Tested with [act](https://github.com/nektos/act):

```
act push -W .github/workflows/push-tag-create-release.yml -v
```


[AB#8474](https://dev.azure.com/fluidframework/235294da-091d-4c29-84fc-cdfc3d90890b/_workitems/edit/8474)
tylerbutler added a commit to tylerbutler/FluidFramework that referenced this pull request Jun 22, 2024
)

This workflow was not updated after build-tools was updated to ESM
instead of CJS. The fix is to use `npm link` to make `flub` available
since the old shim was removed when we switched to ESM.

Tested with [act](https://github.com/nektos/act):

```
act push -W .github/workflows/push-tag-create-release.yml -v
```


[AB#8474](https://dev.azure.com/fluidframework/235294da-091d-4c29-84fc-cdfc3d90890b/_workitems/edit/8474)
tylerbutler added a commit that referenced this pull request Jun 25, 2024
…21593)

Ports #21556 from main to RC5.

This workflow was not updated after build-tools was updated to ESM
instead of CJS. The fix is to use `npm link` to make `flub` available
since the old shim was removed when we switched to ESM.

Tested with [act](https://github.com/nektos/act):

```
act push -W .github/workflows/push-tag-create-release.yml -v
```
tylerbutler added a commit that referenced this pull request Jun 25, 2024
…21594)

Ports #21556 from main to RC4.

This workflow was not updated after build-tools was updated to ESM
instead of CJS. The fix is to use `npm link` to make `flub` available
since the old shim was removed when we switched to ESM.

Tested with [act](https://github.com/nektos/act):

```
act push -W .github/workflows/push-tag-create-release.yml -v
```
tylerbutler added a commit to tylerbutler/FluidFramework that referenced this pull request Jun 25, 2024
)

This workflow was not updated after build-tools was updated to ESM
instead of CJS. The fix is to use `npm link` to make `flub` available
since the old shim was removed when we switched to ESM.

Tested with [act](https://github.com/nektos/act):

```
act push -W .github/workflows/push-tag-create-release.yml -v
```


[AB#8474](https://dev.azure.com/fluidframework/235294da-091d-4c29-84fc-cdfc3d90890b/_workitems/edit/8474)
rohandubal pushed a commit that referenced this pull request Jun 26, 2024
…21623)

Ports #21556 from main to 2.0.

This workflow was not updated after build-tools was updated to ESM
instead of CJS. The fix is to use `npm link` to make `flub` available
since the old shim was removed when we switched to ESM.

Tested with [act](https://github.com/nektos/act):

```
act push -W .github/workflows/push-tag-create-release.yml -v
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: build Build related issues base: main PRs targeted against main branch
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants