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

feat: correct .github workflows from new command to work with docker case #193

Merged
merged 4 commits into from
Sep 3, 2024

Conversation

dj8yfo
Copy link
Collaborator

@dj8yfo dj8yfo commented Aug 1, 2024

No description provided.

@dj8yfo dj8yfo marked this pull request as ready for review August 5, 2024 07:50
@dj8yfo
Copy link
Collaborator Author

dj8yfo commented Aug 5, 2024

@race-of-sloths include

@race-of-sloths
Copy link

race-of-sloths commented Aug 5, 2024

@dj8yfo Thank you for your contribution! Your pull request is now a part of the Race of Sloths!
Do you want to apply for monthly streak? Get 8+ score for a single PR this month and receive boost for race-of-sloths!

Shows profile picture for the author of the PR

Current status: executed
Reviewer Score
@frol 8

Your contribution is much appreciated with a final score of 8!
You have received 84 (80 base + 5% lifetime bonus) Sloth points for this contribution

What is the Race of Sloths

Race of Sloths is a friendly competition where you can participate in challenges and compete with other open-source contributors within your normal workflow

For contributors:

  • Tag @race-of-sloths inside your pull requests
  • Wait for the maintainer to review and score your pull request
  • Check out your position in the Leaderboard
  • Keep weekly and monthly streaks to reach higher positions
  • Boast your contributions with a dynamic picture of your Profile

For maintainers:

  • Score pull requests that participate in the Race of Sloths
  • Engage contributors with fair scoring and fast responses so they keep their streaks
  • Promote the Race to the point where the Race starts promoting you
  • Grow the community of your contributors

Feel free to check our website for additional details!

Bot commands
  • For contributors
    • Include a PR: @race-of-sloths include to enter the Race with your PR
  • For maintainers:
    • Assign points: @race-of-sloths score [1/2/3/5/8/13] to award points based on your assessment.
    • Reject this PR: @race-of-sloths exclude to send this PR back to the drawing board.
    • Exclude repo: @race-of-sloths pause to stop bot activity in this repo until @race-of-sloths unpause command is called

@dj8yfo dj8yfo force-pushed the cargo_near_docker_github_workflows branch 2 times, most recently from aa09a9e to cf4a499 Compare August 7, 2024 11:13
@dj8yfo dj8yfo force-pushed the cargo_near_docker_github_workflows branch 3 times, most recently from 7f3ce85 to b78857a Compare August 15, 2024 20:07
env:
# WASM reproducibility check akin to SourceScan won't be available for staging contracts, deployed from PRs,
# as pull request git refs `refs/pull/NUMBER/merge` are somewhat harder to access and live only as long as PRs do
CARGO_NEAR_REPRODUCIBLE_DISABLE_PUSHED_TO_REMOTE_GIT_CHECK: true
Copy link
Contributor

Choose a reason for hiding this comment

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

I could not remember why I did not review this PR, but then I remembered that I did and raised the concern offline, so here I am again.

This env variable looks like a hack to me. I'd rather consider having a flag --allow-dirty that will use the local folder instead of cloning it from remote.

What do you think?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

--skip-git-remote-check then?, because the repo is clean at the moment of build and dirty isn't the problem

Copy link
Contributor

Choose a reason for hiding this comment

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

I mean, I would love to have a command that would build from my project folder (not cloning it, not checking remote), and I think with this command we can kill two birds with one stone

Copy link
Collaborator Author

@dj8yfo dj8yfo Aug 29, 2024

Choose a reason for hiding this comment

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

that would be longer to implement and more complex code overall, than just --skip-git-remote-check.
primary case for docker build is when source code is available to link to it in metadata.

--skip-git-remote-check (deploy-only flag) is specifically for this bump with temporary branches in prs for staging builds in workflows, which shouldn't be a frequent case. docker is used here to be the same environment as production builds.

to have a command that would build from my project folder (not cloning it, not checking remote)

that is --no-docker --no-locked

@dj8yfo dj8yfo force-pushed the cargo_near_docker_github_workflows branch from 70b1f35 to 7926fd7 Compare August 19, 2024 10:09
@dj8yfo dj8yfo marked this pull request as draft August 19, 2024 10:17
@dj8yfo dj8yfo force-pushed the cargo_near_docker_github_workflows branch from 7926fd7 to 95713a6 Compare August 22, 2024 12:45
@dj8yfo dj8yfo force-pushed the cargo_near_docker_github_workflows branch from 95713a6 to a869650 Compare August 30, 2024 17:52
dj8yf0μl added 3 commits September 2, 2024 22:38
chore: skip git remote check on specific env set

fmt: apply fmt to `./cargo-near/src/commands/new/new-project-template/tests/`

chore: comment to highlight possible impl with `refs/pull/NUMBER/head`

doc: example workflows configuration

doc: add link to `cargo near new` workflows in src

chore: skip pushed to remote git check on specific env

feat: update flow gen with `env!("CARGO_PKG_VERSION")` and staging env

chore: comment in src
@dj8yfo dj8yfo force-pushed the cargo_near_docker_github_workflows branch from f2f3969 to b0d699b Compare September 2, 2024 19:54
@dj8yfo
Copy link
Collaborator Author

dj8yfo commented Sep 3, 2024

output of diff -r old/.github/workflows new/.github/workflows (new is cargo new project from pr, old is cargo new project from latest 0.8.2 release)

diff --color -r old/.github/workflows/deploy-production.yml new/.github/workflows/deploy-production.yml
18c18
<         run: curl --proto '=https' --tlsv1.2 -LsSf https://github.com/near/cargo-near/releases/download/cargo-near-v0.6.2/cargo-near-installer.sh | sh
---
>         run: curl --proto '=https' --tlsv1.2 -LsSf https://github.com/near/cargo-near/releases/download/cargo-near-v0.8.2/cargo-near-installer.sh | sh
diff --color -r old/.github/workflows/deploy-staging.yml new/.github/workflows/deploy-staging.yml
37c37
<         run: curl --proto '=https' --tlsv1.2 -LsSf https://github.com/near/cargo-near/releases/download/cargo-near-v0.6.2/cargo-near-installer.sh | sh
---
>         run: curl --proto '=https' --tlsv1.2 -LsSf https://github.com/near/cargo-near/releases/download/cargo-near-v0.8.2/cargo-near-installer.sh | sh
38a39,42
>         # `--skip-git-remote-check` was used
>         # as pull request git refs `refs/pull/NUMBER/merge` are somewhat harder to access and live only as long as PRs do
>         # 
>         # WASM reproducibility check akin to SourceScan won't be available for staging contracts, deployed from PRs 
40c44
<           cargo near deploy "${{ env.NEAR_CONTRACT_PR_STAGING_ACCOUNT_ID }}" \
---
>           cargo near deploy --skip-git-remote-check "${{ env.NEAR_CONTRACT_PR_STAGING_ACCOUNT_ID }}" \

@dj8yfo dj8yfo marked this pull request as ready for review September 3, 2024 20:18
Copy link
Contributor

@frol frol left a comment

Choose a reason for hiding this comment

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

@race-of-sloths score 8

@frol frol merged commit a805427 into near:main Sep 3, 2024
17 checks passed
@frol frol mentioned this pull request Sep 3, 2024
frol added a commit that referenced this pull request Sep 13, 2024
## 🤖 New release
* `cargo-near`: 0.8.2 -> 0.9.0
* `cargo-near-build`: 0.1.0 -> 0.1.1

<details><summary><i><b>Changelog</b></i></summary><p>

## `cargo-near`
<blockquote>

##
[0.9.0](cargo-near-v0.8.2...cargo-near-v0.9.0)
- 2024-09-12

### Added

- Fixed GitHub CI staging workflow generated by `cargo near new` command
to work correctly with docker case
([#193](#193))
- Extracted cargo-near-build into a standalone crate to be able to use
it in near-workspaces and other places without the rest of the heavy
dependencies of cargo-near
([#198](#198))
- Added tracking of `cargo near new` usage to collect statistics of the
command usage ([#192](#192))

### Fixed

- Addressed warnings in `cargo build -p cargo-near-build` cmd in
releaze-plz flow ([#212](#212))

### Other

- Updated near-* dependencies to 0.26 release
([#220](#220))
- Use "tracing" for logging and loading indicators
([#216](#216))
- update docker image and sdk version in `cargo near new` template
([#218](#218))
- [**breaking**] updates near-* packages to 0.25 version. Updates
near-sdk to 5.4 ([#215](#215))
</blockquote>

## `cargo-near-build`
<blockquote>

##
[0.1.1](cargo-near-build-v0.1.0...cargo-near-build-v0.1.1)
- 2024-09-12

### Added

- Fixed GitHub CI staging workflow generated by `cargo near new` command
to work correctly with docker case
([#193](#193))

### Other

- Use "tracing" for logging and loading indicators
([#216](#216))
- fix clippy ([#219](#219))
</blockquote>


</p></details>

---
This PR was generated with
[release-plz](https://github.com/MarcoIeni/release-plz/).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants