-
Notifications
You must be signed in to change notification settings - Fork 3
feat: publish index files for published packages to the registry #48
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
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎
|
16bd5d0
to
dbc53a4
Compare
8a95478
to
d8ac6f2
Compare
d8ac6f2
to
bc1c36a
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In terms of merging this, I think we might need to split the sway PR into two: One with the forc-pkg changes needed for this PR, and a separate one for reading from the index. That way we can merge this, and test the forc-build (fetching from the index) against the real repo. So the order could be:
- merge forc-pkg PR with library changes (
IndexFile
,PackageEntry
, etc) - release sway
- merge this PR pointing at the sway release
- test & merge the forc-build PR that fetches from the real registry repo
What do you think?
We could do that but i was thinking we keep this aside for the time being and only get the sway PR merged first. Sway repo PR is self containing at the moment as building things is not connected to publishing things. One can still publish without this PR. Just that packages needs to be manually added with a PR to the index repo. So i am seeing this as more like an automation, more than a thing that unblocks sway repo PR. That being said If you prefer to keep the flow you described i can also do that too. |
In memory ssh key authentication works now. But there is a caveat. For git2 distribution (not the rust crate but system dependency) the key should be in OpenSSL PEM format which can be generated like the following: ssh-keygen -t rsa -b 4096 -m PEM -f ~/id_rsa
The env variable > echo $SSH_KEY
-----BEGIN RSA PRIVATE KEY-----
...
...
-----END RSA PRIVATE KEY----- |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great work on this!
Disclaimer
For now this branch is pointing to FuelLabs/sway@f4477cf for forc-pkg. This will be the version that is going to be released soon from sway repo side. Before merging we should move it to the released instance, either
0.67.1
or0.68.0
whichever comes next.Description
This PR connects forc, registry fetching and actual publishing step in forc.pub. Basically for each published package we are generating an index file, and corresponding entry to that file to describe the package. This index information is stored in a registry. Backend actually commits these files once the publishing is completed.
This file then used by forc to resolve version and package name tuple to an actual IPFS CID that can be fetched. This is done in FuelLabs/sway#7038.
How to e2e test
Following steps outline some way to test this change e2e with new forc that can build registry packages. The steps assume this PR is pointing to the dummy repo, if not first point to dummy repo manually by changing the repo name and org in
src/handlers/publish.rs
.forc.pub
and come tokayagokalp/index-file
branchcp .env .env.local
5.Place IPFS, GITHUB client you fetched from the vault into .env.local and also place your GITHUB_TOKEN/PAT there.
./scripts/start_local_db.sh
(make sure docker daemon is running)app/
folder and runnpm i
thennpm start
localhost:3000
login with github../target/debug/forc-publish --registry-url http://0.0.0.0:8080/ --token <TOKEN>
(I publishedstd
soforc-publish
location was like this fromsway-lib-std
folder)forc
project and depend on this new dependency by version