-
Notifications
You must be signed in to change notification settings - Fork 17
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(source-scan): git checks, git metadata #159
Merged
frol
merged 19 commits into
near:source-scan-integration
from
dj8yfo:source-scan-git-checks-metadata
May 10, 2024
Merged
feat(source-scan): git checks, git metadata #159
frol
merged 19 commits into
near:source-scan-integration
from
dj8yfo:source-scan-git-checks-metadata
May 10, 2024
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Based on contracts deployed from sdk pr: near/near-sdk-rs#1178 : near contract call-function as-read-only sample-crate.testnet contract_source_metadata json-args {} network-config testnet now => {
"build_info": {
"build_command": [
"cargo",
"near",
"build",
"--no-release",
"--no-doc"
],
"build_environment": "dj8yfo/sourcescan:0.x.x-dev-cargo-near-build-cmd-repo@sha256:e6b0ba022673c5845df842173b005426573c9583f78cd8a1782462e59807e05a",
"contract_path": "",
"source_code_snapshot": "git+https://github.com/dj8yfo/sample_no_workspace.git?rev=6c5ae44150ce51349a95e1605ba053c4fe53cf28"
},
"link": "https://github.com/dj8yfo/sample_no_workspace/tree/6c5ae44150ce51349a95e1605ba053c4fe53cf28",
"standards": [
{
"standard": "nep330",
"version": "1.2.0"
}
],
"version": "0.7.7"
}
near contract call-function as-read-only sample-subpath-in-repo.testnet contract_source_metadata json-args {} network-config testnet now => {
"build_info": {
"build_command": [
"cargo",
"near",
"build",
"--no-release",
"--no-doc"
],
"build_environment": "dj8yfo/sourcescan:0.x.x-dev-cargo-near-build-cmd-repo@sha256:e6b0ba022673c5845df842173b005426573c9583f78cd8a1782462e59807e05a",
"contract_path": "self-updates/update",
"source_code_snapshot": "git+https://github.com/dj8yfo/sample_workspace.git?rev=b2d5580037c84fd4038b467564a9be9e520611de"
},
"link": "https://github.com/dj8yfo/sample_workspace/tree/b2d5580037c84fd4038b467564a9be9e520611de",
"standards": [
{
"standard": "nep330",
"version": "1.2.0"
}
],
"version": "1.7.7"
} near contract call-function as-read-only sample-crate-in-submodule.testnet contract_source_metadata json-args {} network-config testnet now => {
"build_info": {
"build_command": [
"cargo",
"near",
"build",
"--no-release",
"--no-doc"
],
"build_environment": "dj8yfo/sourcescan:0.x.x-dev-cargo-near-build-cmd-repo@sha256:e6b0ba022673c5845df842173b005426573c9583f78cd8a1782462e59807e05a",
"contract_path": "self-updates/update",
"source_code_snapshot": "git+https://github.com/dj8yfo/sample_workspace_with_submodules.git?rev=3d87c81517e1e23a5716c300fe4789b1aafc4c6f"
},
"link": "https://github.com/dj8yfo/sample_workspace_with_submodules/tree/3d87c81517e1e23a5716c300fe4789b1aafc4c6f",
"standards": [
{
"standard": "nep330",
"version": "1.2.0"
}
],
"version": "1.0.0"
}
near contract call-function as-read-only bitbucket-scratch.testnet contract_source_metadata json-args {} network-config testnet now => {
"build_info": {
"build_command": [
"cargo",
"near",
"build",
"--no-release",
"--no-doc"
],
"build_environment": "dj8yfo/sourcescan:0.x.x-dev-cargo-near-build-cmd-repo@sha256:e6b0ba022673c5845df842173b005426573c9583f78cd8a1782462e59807e05a",
"contract_path": "",
"source_code_snapshot": "git+https://feepdake27@bitbucket.org/dj8yfomule/scratch_check_git.git?rev=219ac475a016eedae17d5f8600cec1b77d64a918"
},
"link": "https://bitbucket.org/dj8yfomule/scratch_check_git/src/master/",
"standards": [
{
"standard": "nep330",
"version": "1.2.0"
}
],
"version": "0.1.0"
}
|
dj8yfo
force-pushed
the
source-scan-git-checks-metadata
branch
from
May 6, 2024 12:55
bde545d
to
7bf9423
Compare
…to `TempDir::path()`
frol
reviewed
May 8, 2024
… `uid_gid` docker cli flag fixes near#159 (comment)
frol
approved these changes
May 10, 2024
frol
pushed a commit
that referenced
this pull request
May 13, 2024
commit ca13500 was lost in merge of #159, as it was accidentally not pushed to remote before merge, which was discovered when testing on [contract](https://github.com/dj8yfo/sample_no_workspace/blob/d42d1c69a3883889c4bb688b11e0a8dffb384a15/Cargo.toml) --- SIDENOTE: commit 787c3a4 fixes somewhat unrelated problem, also present in `main` . It can be cherry-picked into a standalone pr to `main` : as `cargo metadata` is called without any additional args (`--features` or whatnot), the following diff: ```diff -near-sdk = { version = "5.1.0", features = ["legacy"], git = "https://github.com/dj8yfo/near-sdk-rs.git", branch = "add_contract_metadata" } +near-sdk = { version = "5.1.0", default-features = false, features = ["wee_alloc", "legacy"], git = "https://github.com/dj8yfo/near-sdk-rs.git", branch = "add_contract_metadata" } ``` results in ```bash Error: 0: `near-sdk` dependency must have the `abi` feature enabled ``` which somewhat contradicts [no explicit `abi` feature](https://github.com/near-examples/factory-rust/blob/main/Cargo.toml#L16) , which is promoted for use by [near-docs](https://github.com/near-examples/factory-rust/pull/2/files#diff-b335630551682c19a781afebcf4d07bf978fb1f8ac04c6bf87428ed5106870f5R74) --------- Co-authored-by: Jacob Lindahl <encody@users.noreply.github.com>
Closed
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Summary of changes:
git dirty
check copied tocargo near build
flow, it produces a warning, unlike the error incargo near deploy
flowsource_code_git_url
field to reproducible build metadatagit pushed to remote
check logic reworkedHEAD
is determinedCARGO_NEAR_SOURCE_CODE_SNAPSHOT
(adapted from cargo::core::SourceId) andCARGO_NEAR_CONTRACT_PATH
are exported into container