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

chore: migrate github-action to cli #1487

Merged
merged 25 commits into from
Oct 6, 2024

Conversation

akshatnema
Copy link
Member

@akshatnema akshatnema commented Jul 28, 2024

Description

PR to add the github action for cli from https://github.com/asyncapi/github-action-for-cli.

Related issue(s)
asyncapi/github-action-for-cli#396

Copy link
Contributor

@github-actions github-actions bot left a comment

Choose a reason for hiding this comment

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

Welcome to AsyncAPI. Thanks a lot for creating your first pull request. Please check out our contributors guide useful for opening a pull request.
Keep in mind there are also other channels you can use to interact with AsyncAPI community. For more details check out this issue.

@aeworxet
Copy link
Contributor

@asyncapi/bounty_team

github-action/Dockerfile Fixed Show fixed Hide fixed
@asyncapi-bot asyncapi-bot added the bounty AsyncAPI Bounty program related label label Aug 21, 2024
@Shurtu-gal
Copy link
Collaborator

/u

@Shurtu-gal
Copy link
Collaborator

@akshatnema any blockers being faced by you?

@akshatnema
Copy link
Member Author

There is no update as I'm researching around the fact on how to manage GitHub Action for CLI.

@Shurtu-gal and @derberg proposals require different configurations, which in fact means we need to have the same package.json for both CLI and it's respective GitHub action.

I'm currently looking at how to use only one configuration and one package.json.

Although the matter looks simple, it will take time to try different approaches, so if I don't achieve a break-through in the nearest couple of days, I'll ask for the Timeline Extension.

Copy link
Member

derberg commented Sep 17, 2024

but the GH action do not need package.json as it is bash and docker based only. So no need for monorepo afaik - I think we talked about it

@akshatnema
Copy link
Member Author

akshatnema commented Sep 18, 2024

@derberg @Shurtu-gal ok so should we do it in a manner that we completely remove the package.json from github action? Since, there is no need of a separate package.json, our whole github action depends on the working of entrypoint.sh and the versioning for github action scripts can be added to existing package.json of cli, right?

@Shurtu-gal
Copy link
Collaborator

@derberg @Shurtu-gal ok so should we do it in a manner that we completely remove the package.json from github action? Since, there is no need of a separate package.json, our whole github action depends on the working of entrypoint.sh and the versioning for github action scripts can be added to existing package.json of cli, right?

That's correct. If I remember correctly the package.json was there just to support the workflows already present.

RUN addgroup -S myuser && adduser -S myuser -G myuser

# Install necessary packages
RUN apk add --no-cache bash git chromium

Check notice

Code scanning / SonarCloud

Arguments in long RUN instructions should be sorted Low

Sort these package names alphanumerically. See more on SonarCloud
@Shurtu-gal
Copy link
Collaborator

@akshatnema sonarcloud is complaining about the Dockerfile building on a image with root as the default user. Maybe the user being added could be used for further steps through

USER myuser

I may have missed out on this during migrating to bash.

@Shurtu-gal Shurtu-gal changed the title New Github action added for cli feat: migrate github-action to cli Oct 4, 2024
@Shurtu-gal
Copy link
Collaborator

/u

Copy link
Collaborator

@Shurtu-gal Shurtu-gal left a comment

Choose a reason for hiding this comment

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

Could you add the test-workflow as well to see if the action is working as intended?

- name: Build Docker image and export
uses: docker/build-push-action@v5
with:
context: .
Copy link
Collaborator

Choose a reason for hiding this comment

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

The context should be different I believe as the DockerFile is inside github-action folder.

@Shurtu-gal Shurtu-gal marked this pull request as ready for review October 5, 2024 10:35
@Shurtu-gal
Copy link
Collaborator

@aeworxet this issue is pretty complicated as some things related to containerizing part is still not working and we still have to do the automation of version locking and bumping. @akshatnema is also pretty new to the CLI repo so is it possible to reclassify this bounty as advanced and extend it for 1-2 weeks.

Copy link

sonarqubecloud bot commented Oct 6, 2024

Quality Gate Failed Quality Gate failed

Failed conditions
2 Security Hotspots

See analysis details on SonarCloud

Copy link
Collaborator

@Shurtu-gal Shurtu-gal left a comment

Choose a reason for hiding this comment

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

LGTM. The version automation part would be done in a separate PR.

@Shurtu-gal Shurtu-gal changed the title feat: migrate github-action to cli chore: migrate github-action to cli Oct 6, 2024
@Shurtu-gal Shurtu-gal merged commit 2f9ccbb into asyncapi:master Oct 6, 2024
23 of 24 checks passed
Souvikns added a commit to Souvikns/cli that referenced this pull request Oct 22, 2024
* chore: update package-lock.json

* fix: add package-lock.json (asyncapi#1542)

* chore: migrate github-action to cli (asyncapi#1487)

* New Github action added for cli

* Added new files in the github-action

* removed monorepo style for github action

* Updated github action with Dockerfile changes

* added command to pack cli for linux, docker build command

* added test-workflow for github-action

* chore: fix docker context

* chore: change docker context

* fix: dockerfile

* changed dockerfile

* fix: dockerfile

* Converted Dockerfile into multi stages

* added github-action folder

* added assets folder to github action image

* deleted act file script

* removed asyncapi.yaml file from .gitignore

* corrected output file for workflow

* updated Dockerfile

* added bundle file

* changed bundle files

* Updated README

* updated output bundle directory

---------

Co-authored-by: asyncapi-bot <[email protected]>
Co-authored-by: Ashish Padhy <[email protected]>

* feat: update oclif to v4 (asyncapi#1546)

* feat: update oclif to v4

* chore: removed unused dependencies

* Update myhook.ts

* chore: update package-lock.json version (asyncapi#1550)

* fix: add description for the start command in AsyncAPI CLI (asyncapi#1534) (asyncapi#1537)


Co-authored-by: Ashish Padhy <[email protected]>

* chore(release): v2.7.1 (asyncapi#1551)

* fix: update npm to latest for windows (asyncapi#1553)

* chore(release): v2.7.2 (asyncapi#1554)

* Update upload-release-assets.yml

---------

Co-authored-by: root <root@LAPTOP-K7PL9FIU>
Co-authored-by: Ashish Padhy <[email protected]>
Co-authored-by: Akshat Nema <[email protected]>
Co-authored-by: asyncapi-bot <[email protected]>
Co-authored-by: Taufiq Hassan <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bounty AsyncAPI Bounty program related label
Projects
Status: Completed
Status: Done
Development

Successfully merging this pull request may close these issues.

5 participants