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

Agoric VS Code Extension Bounty #5156

Closed
jeetraut opened this issue Apr 19, 2022 · 21 comments
Closed

Agoric VS Code Extension Bounty #5156

jeetraut opened this issue Apr 19, 2022 · 21 comments
Assignees
Labels
bounty enhancement New feature or request

Comments

@jeetraut
Copy link

Description

Create a Visual Studio Code extension that automates the installation of the Agoric SDK. This extension should install all dependencies as well as upgrade previously installed versions.

Context

Visual Studio Code is a popular development environment for many software engineers. Automating the installation process of the Agoric SDK will make it easier for developers to get started building Agoric smart contracts.
Furthermore we aim to extend this bounty to build a tool like Remix that allows developers to rapidly prototype and test smart contracts in a local dev environment.

Acceptance Criteria

Implementation plan agreed to with Agoric team Criteria in description and demonstration of the Visual Studio Code extension.

Time Estimation

6 weeks

Reward

$5,000 USD
Payment will be made in USD. The developer is responsible for providing their completed tax documents (W9 for US based developers and/or W8 or W8-BEN-E for non-US based developers) and providing their banking details in order to receive payment.

Applicant Assessment Criteria

Important: Please provide a clear workplan for how you will approach this bounty. Use the work plan as an initial demonstration that you would be a good candidate. Bounties will require coordination with the Agoric team, so unfortunately only plans submitted in English will be considered.
Applicants will be assessed based on the following criteria:

  • Issue-specific domain experience
  • Issue-specific technical capability
  • Familiarity with Agoric's platform and destination chain platform
  • JavaScript experience
  • Availability and communication

Review Process

  • Agoric team reviews your submitted workplan on Gitcoin
  • It is best to join our Discord and post your Gitcoin name in the bounties channel, so that we can follow up with you. Otherwise, we will write on your gitcoin profile wall and say hello!
  • Agoric contacts you to provide reference projects / sample code for engineering review
  • Introductory call to discuss your plans and expected timeline
  • You join the Agoric Discord bounties channel (if you haven’t done so already)
  • Agoric accepts you on Gitcoin and you get started!

References

@jeetraut jeetraut added enhancement New feature or request bounty labels Apr 19, 2022
@jeetraut jeetraut self-assigned this Apr 19, 2022
@gitcoinbot
Copy link

gitcoinbot commented Apr 20, 2022

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


Work has been started.

These users each claimed they can complete the work by 264 years, 6 months from now.
Please review their action plans below:

1) vaibhavgeek has applied to start work (Funders only: approve worker | reject worker).

I have experience of building many VS code extensions for Fun. I would need understanding of Agoric Smart Contracts to build this feature but can dive as have a good understanding of Solidity, Hardhat and Typescript. I can deliver this in 6 weeks as mentioned but would require certain clarification on VS code extension expected.
2) danbamikiya has been approved to start work.

Hello I'm interested in this work, I'm very skilled in JavaScript, React, NextJS, TypeScript, Tailwind CSS and SCSS and I have a good understanding of Solidity.
I have experience building VSCode extensions as seen here with 287 installs. I also have experience building solutions around JavaScript SDKs and also automating the installation process of SDKs in Github Actions.
My github profile: github.com/danBamikiya
My portfolio: dan-bamikiya.herokuapp.com

Work Plan
Familiarize myself with the Agoric SDK and Agoric Smart Contracts
Build a VSCode extension to automate the installation of Agoric SDK and updating the SDK version to the latest version.
The VSCode extension will also automate the installation of Agoric CLI
Verify the work done with the team.
Submit the work

I look forward to hearing from you!
3) litmus-zhang has applied to start work (Funders only: approve worker | reject worker).

First off, I will create a functional workflow similar to creating a promise in Javascript,

  • First checkpoint : check if node is installed, then install node (via npm)

  • install yarn while checking if there is any older version of Agoric in Path

  • check if git is installed (git - - version command) and then clone the repo,

  • awaiting the successful cloning, a command to change working directory into the agoric-sdk folder.

  • run yarn install while yarn build command await execution

  • activating the agoric cli tool then check the current version is equal to the cloned version.

As previously stated, this whole workflow is my action plan based on js promise. With a boolean check for each checkpoint. (Handling edge cases, internet glitch )

I will start with gitpod.yml (gitpod.io) as a testing zone for this workflow to check for any inconsistencies while working on the project,
4) arun06mc has applied to start work (Funders only: approve worker | reject worker).

I would like to work on this bounty. I like the concept of extending it to IDE's like Remix.
5) piyushpi07 has applied to start work (Funders only: approve worker | reject worker).

Hello, I am interested in this issue. I have 3 years of experience in JavaScript, NodeJs, ReactJS, and web3 development.
Work Plan:

  • Understanding Agoric SDK and CLI
  • Understanding system and environment requirements for Agoric SDK installation.
  • Building a multi-os supported VS code extension to automate installation and to update Agoric SDK as per the latest releases.
  • Extension testing on different platforms and OS.
    6) leecrypto has applied to start work (Funders only: approve worker | reject worker).

I'd like to work on this project
7) sam-ranade has applied to start work (Funders only: approve worker | reject worker).

Understand the Agoric SDK at a high level
Understand the SDK installation requirements
Understand the SDK invocation and execution requirements
VS Extension possibilities
Add project type Agoric
Sets the default tool chain to Agoric
Provide templates for project creation if possible
Provide boiler plate code if possible
Compile and Execute the code locally / remote depending on how the SDK works
Provide debugging support if the SDK supports such capabilities
8) xinminsu has applied to start work (Funders only: approve worker | reject worker).

  1. Tasks design
    a. prerequisites check: node,yarn, git install or not, if not, warning user to install, make a new install directory
    b.sdk version checking, if it's the latest, no need to install, if no, update to latest version
    c.clone agotic sdk, update agoric sdk, checkout hackathon branch
    d.install agotic cli, yarn install, yarn build, sudo yarn link-cli /usr/local/bin/agoric
  2. implement the Agoric SDK Visual Studio Code installation extension
    , Test the Agoric SDK Visual Studio Code installation extension
  3. Publish the Agoric SDK Visual Studio Code installation extension
    9) drswim94 has applied to start work (Funders only: approve worker | reject worker).

Hiring a very strong team and getting it done

Learn more on the Gitcoin Issue Details page.

@danBamikiya
Copy link
Contributor

I'll be updating this github issue with my progress on the extension. Lets Go! 🚀🚀

@jeetraut
Copy link
Author

Hi @danBamikiya just wanted to check on how things are progressing on the bounty.

@danBamikiya
Copy link
Contributor

Hi @danBamikiya just wanted to check on how things are progressing on the bounty.

Hello @jeetraut, I'm making progress on the extension and it's currently almost completed, at the current stage, it automatically installs the Agoric SDK when the Extension is installed, I'm also adding an option that allows users set if the extension should update the SDK automatically when VSCode is opened or they do it at their own time by using a custom VSCode keybinding (like Ctrl + Shift + U) when they want to update at their own time.

Since some users could already be using this keybinding, they'll be an array of keybindings to choose from, which is what I'm currently working on.

@danBamikiya
Copy link
Contributor

Just realized that there's a message on the Discord channel for me, I'm not that frequent on discord but I'll be making the updates there as from now on.

I've also been checking out the Remix tool and how one can be built for Agoric smart contract and I have some ideas already we can iterate on them when I finish work on this extension

@danBamikiya
Copy link
Contributor

@jeetraut the keybinding is a shortcut like this for some developers who may prefer it

filter-on-keys.png

@dckc
Copy link
Member

dckc commented Jun 2, 2022

... I'm not that frequent on discord but I'll be making the updates there as from now on.

updates here should suffice. no need to use discord unless you want to.

@jeetraut
Copy link
Author

@danBamikiya any updates?

@jeetraut
Copy link
Author

Hey @danBamikiya just wanted to follow up here.

@danBamikiya
Copy link
Contributor

danBamikiya commented Jun 28, 2022

@jeetraut Soo sorry, the Agoric Extension is(was) done and I was testing publishing the extension but had my laptop stolen that day in a bus in Lagos (where I stay), I was able to get another one last weekend and I've started setting it up and recovering my files, I've begun rewriting the extension yesterday and I'm 80% done, should be done tomorrow and ping you.

Concerning what was done:

  • It automatically installs and setups the Agoric SDK on startup
  • It gives users option to turn off automatic installation on startup (they'll do the manual setup themselves)
  • It configures keybindings for the extension commands
  • For manual setup users, it shows information popups that the latest version of Agoric SDK is available
  • I've written integration tests for the extension and its features

@danBamikiya
Copy link
Contributor

danBamikiya commented Jul 6, 2022

@jeetraut The Agoric Extension is completed 🎉 We can schedule a call when you want to preview and hand off
@dckc

@jeetraut
Copy link
Author

@danBamikiya Can you send me a link to your repo?

@danBamikiya
Copy link
Contributor

danBamikiya commented Jul 12, 2022

@jeetraut https://github.com/danBamikiya/agoric-vscode-extension (currently: ffe7003 )
The average duration for installation and building of the SDK is around 3 mins
I also added a custom 'Agoric' output channel for the extension logs which opens up automatically when the extension finishes installing and building the SDK

@gitcoinbot
Copy link

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


Work for 5002.501 USD (5002.5 USD @ $1.0/USD) has been submitted by:

  1. @danbamikiya

@jeetraut please take a look at the submitted work:


@dckc
Copy link
Member

dckc commented Jul 13, 2022

Edit: oops! reviewed the wrong submission.

It works (on linux)

I installed it and ran the agoric sdk install command, and it pretty much worked - cloned the SDK repo, ran yarn install and yarn build.

$ ls -l xinminsu.agsi-0.0.1.vsix 
-rw-rw-r-- 1 connolly connolly 8955 Jul 12 23:22 xinminsu.agsi-0.0.1.vsix

from https://marketplace.visualstudio.com/items?itemName=xinminsu.agsi
Version 0.0.1
Released on 4/29/2022, 1:44:28 AM
Last updated 4/29/2022, 1:46:45 AM

Minor issues:

  • agoric --version failed

The diagnostic explains how to fix PATH, but I wonder if people will notice that. I'm not sure how to do better, except perhaps to show the diagnostic in an error/warning dialog.

connolly@dcpc:~/agoric-sdk$ yarn link-cli ~/bin/agoric
yarn run v1.22.19
$ yarn run create-agoric-cli /home/connolly/bin/agoric
$ node ./scripts/create-agoric-cli.cjs /home/connolly/bin/agoric
Script directory /home/connolly/bin does not appear in $PATH
(You may want to `export PATH=$PATH:/home/connolly/bin' to add it to your PATH environment variable)
ensuring /home/connolly/bin exists
creating /home/connolly/bin/agoric
Done in 0.22s.
connolly@dcpc:~/agoric-sdk$ agoric --version
agoric: command not found

image

  • some link markup is a little goofy

image

  • it assumes you have a C compiler installed. maybe mention that in the requirements? Or is that the norm in the JS world?

Windows?

I expect it works on a Mac, but I wonder about Windows. If the user is not running WSL, does it give a good diagnostic?

Wishes

There's a bit of a "now what?" feeling after it installs. Maybe...

Some ideas for follow-on work:

@jeetraut
Copy link
Author

Thanks for the feedback, @dckc! @danBamikiya if you could address the minor issues that @dckc brought up and potentially the wishes it would be really appreciated.Could you also provide a short video of the demo of the plugin? We like to keep these on record. Thanks!

@jeetraut
Copy link
Author

Hi @danBamikiya just wanted to follow up on getting the demo video. Once we have that we can begin the review. Thanks!

@dckc
Copy link
Member

dckc commented Jul 20, 2022

um... also... the review I did above was for the wrong piece of code, I think. oops.

@danBamikiya
Copy link
Contributor

danBamikiya commented Aug 9, 2022

Hi @jeetraut @dckc, yes that's isn't the one I built, I've pre-released the one I built on the extensions marketplace with the name "Agoric", you'll see it with the company's official logo.

I have resolved the minor issues in the latest pre-release (v0.0.5) and implemented the requested diagnostics to be shown, I'm also helping the users mitigate some path problems they might run into especially on Windows platform.

Here's a video demo: https://vimeo.com/737986284
You can also install the pre-release to test it yourself: https://marketplace.visualstudio.com/items?itemName=danbmky.agoric-vscode

Decisions taken that affects users experience

  1. I was previously running the cli commands in the internal nodejs process and showing the output in the custom Agoric output channel, this means users can't see the extension doing anything i.e they're kept in the "dark" till the extension is finished with its thing and they can now view the success/failure and debug logs in the Output channel and modals.
    The problem with this is:
  • Users don't know what is happening with extension, whether it is working or not
  • This process was incredibly slower compared to running the commands in the terminal, affecting users experience greatly especially on Windows
  1. Instead, now, I send the commands to the Terminal, meaning users can now see the whole process as soon as they install the extension but this has tradeoffs too:
  • Once the commands are sent to the terminal, 'it returns back to the flow' of the process, meaning, there's no 'awaiting' for those commands, to do anything, the commands run on their own and the extension flow runs on its own (and this behaviour isn't even documented in the vscode API docs)
  • I can only do other things that depend on the success/failure of those commands by predicting user behaviour, for example, the SDK version and diagnostics I'm showing in the modals:
    image

will be shown when the commands in the Terminal are successful, which is known by calling them when the Terminal is inactive (killed or the user has switched to another terminal) meanwhile these are also shown in the Output channel too.
So if the commands in the terminal fails/succeed, the user knows because the Terminal is still open and when the kill/close/switch the Terminal, the success or failure is logged in the Output channel and displayed in the modals (as seen in the screen shot).

Predicting the user behaviour this way to work around the vscode Terminal behaviour is pretty okay. I plan to reach out to the vscode dev team to further understand this behaviour & know if there are better workarounds.

Wishes

Because of this vscode Terminal behaviour, doing further things like agori-init, agoric start dev after the setup isn't possible since we can't know the state (success/failure) of the commands in the Terminal directly.

What we can do concerning this is show a dialog (like the ones in the screenshot) asking the user if they want to agoric-init the default project which the extension can then do for them.

I can explain and demonstrate these things in the review so you can better understand these, incase they weren't clear.
Once the extension is approved in review, I'll officially release v1.0.0 🎉 🎉

@kennyrowe
Copy link
Contributor

@danBamikiya I'm trying to test this on my machine but I can't get the extension to work unless node is running lts (v16.14.0). Can the extension check for this?

@danBamikiya
Copy link
Contributor

@kennyrowe Yes, that behavior is because the extension is under pre-release so vsce can't pre-release an extension except it is using a vscode engine of ^1.63.0 as seen in this commit. Once you're done reviewing the extension, I'll officially release it to the marketplace as v1.0.0 which can then work with other node versions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bounty enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

6 participants