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(source-scan): git checks, git metadata #159

Merged

Conversation

dj8yfo
Copy link
Contributor

@dj8yfo dj8yfo commented Apr 26, 2024

Summary of changes:

Screenshot_20240503_204916

@dj8yfo dj8yfo marked this pull request as ready for review April 26, 2024 20:07
@dj8yfo dj8yfo marked this pull request as draft May 2, 2024 12:01
@dj8yfo
Copy link
Contributor Author

dj8yfo commented May 3, 2024

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 dj8yfo marked this pull request as ready for review May 3, 2024 17:54
@dj8yfo dj8yfo force-pushed the source-scan-git-checks-metadata branch from bde545d to 7bf9423 Compare May 6, 2024 12:55
@dj8yfo dj8yfo marked this pull request as draft May 8, 2024 14:05
@dj8yfo dj8yfo marked this pull request as ready for review May 8, 2024 19:35
@dj8yfo dj8yfo marked this pull request as draft May 9, 2024 14:29
@dj8yfo dj8yfo marked this pull request as ready for review May 9, 2024 14:32
@frol frol merged commit bf8696b into near:source-scan-integration May 10, 2024
14 checks passed
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>
@dj8yfo dj8yfo deleted the source-scan-git-checks-metadata branch May 13, 2024 13:37
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.

None yet

2 participants