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

Move capabilities into own package PLZ #80

Closed
Gozala opened this issue Sep 30, 2022 · 8 comments
Closed

Move capabilities into own package PLZ #80

Gozala opened this issue Sep 30, 2022 · 8 comments
Assignees
Milestone

Comments

@Gozala
Copy link
Contributor

Gozala commented Sep 30, 2022

Hey @hugomrdias I would really like to decouple iterations on protocol from iterations on access SDK etc.. can we please just move all the capability definitions into own package e.g. @web3-storage/protocol or @web3-storage/capabilities and pull those in from wherever we need.

@hugomrdias
Copy link
Contributor

we can for sure, do we need to do it now though ? i would like to avoid having everyone using capabilities directly we should have an abstraction like the Agent or something else so we can make changes in the caps and backend without bringing the world

@Gozala
Copy link
Contributor Author

Gozala commented Oct 11, 2022

I think it makes sense to have a package with basically protocols, that is capabilities and some markdowns explaining the interaction.

Those could be the pulled in by the agent / client library that our tools and libraries can depend upon. Those also could be pulled in by various service implementations.

Current setup makes iteration on the protocol somewhat coupled with iteration on the implementation and I would like to be able to decouple them a bit more

@hugomrdias hugomrdias added this to the 0.9 milestone Oct 13, 2022
@hugomrdias hugomrdias modified the milestones: 0.9, w3up v1 Nov 7, 2022
@Gozala Gozala self-assigned this Nov 17, 2022
@Gozala Gozala added this to the w3up phase 1 milestone Nov 17, 2022
@gobengo gobengo assigned gobengo and unassigned Gozala Nov 23, 2022
@gobengo
Copy link
Contributor

gobengo commented Nov 23, 2022

I'll do this next week. Accidentally created a duplicate. Copying this description from that:

Acceptance Criteria:

  • w3protocol monorepo has a new package containing just the capability objects used in the protocols
  • clients like access-client import the capabilities from the capabilities package

Ideas

  • Should we also split up the capabilities by service: e.g. accounts, storage, upload ?

@Gozala
Copy link
Contributor Author

Gozala commented Nov 23, 2022

Should we also split up the capabilities by service: e.g. accounts, storage, upload ?

definitely split into separate modules, not sure separate packages are worth it, probably just going to only increase overhead right now

@gobengo
Copy link
Contributor

gobengo commented Nov 28, 2022

@hugomrdias I'm assuming it's a good idea to release this to npm. I think that means I should add to this conditional to also run the release job for packages/capabilities? https://github.com/web3-storage/w3protocol/blob/191e2427529e113d67d5a6ec8ab7e7b4368b1c58/.github/workflows/release.yml#L40

@gobengo
Copy link
Contributor

gobengo commented Nov 29, 2022

After merge

  • ensure CI releases to npm

After release:

gobengo added a commit that referenced this issue Nov 30, 2022
…web3-storage/capabilities (#218)

Motivation:
* #80

To do:
* [x] initial package split
* [x] remove capabilities dir from packages/access-client and fix
imports in access-client
* [x] fix imports from other packages that were importing from
access-client/capabilities
* [x] consider splitting to `capabilities/{service}/types` not
`capabilities/types`
* decided not to unless requested (makes exports map even more
complicated, can do later)
* [x] GH actions should run tests on packages/capabilities
* [x] .github/workflows/release.yml does npm/docs jobs if paths_released
contains packages/capabilities

Co-authored-by: Irakli Gozalishvili <contact@gozala.io>
gobengo added a commit that referenced this issue Dec 1, 2022
Motivation:
*
#80 (comment)
* trying to get release-please-action to generate a release PR for
packages/capabilities
* I would have expected it in this action, but there was [an
error](https://github.com/web3-storage/w3protocol/actions/runs/3587365143/jobs/6037622712#step:2:44)
```
Expected 5 releases, only found 4
⚠ Missing 1 paths: packages/capabilities
⚠ No version for path packages/capabilities
```

Theory:
* maybe these errors are because I hadn't added this package to the
manifest?
@gobengo
Copy link
Contributor

gobengo commented Dec 1, 2022

bengo@bengo ~/tmp/test-caps ⚡  node
Welcome to Node.js v18.10.0.
Type ".help" for more information.
> (await import('@web3-storage/capabilities')).Voucher.claim.invoke({ with: 'did:key:foo', nb: { product: 'did:key:foo', identity: 'mailto:bengo@dag.house' } })
IssuedInvocation {
  issuer: undefined,
  audience: undefined,
  proofs: [],
  capabilities: [ { can: 'voucher/claim', with: 'did:key:foo', nb: [Object] } ],
  expiration: undefined,
  lifetimeInSeconds: undefined,
  notBefore: undefined,
  nonce: undefined,
  facts: []
}

@gobengo
Copy link
Contributor

gobengo commented Dec 1, 2022

https://web3-storage.github.io/w3protocol/modules/_web3_storage_capabilities.html

The docs can be updated via the 'manual' github action on this repo for package=docs. (example)

For some reason the 'release' pipeline seems to skip docs job, even when it doesn't skip npm job which has the same if.

  • I debugged this briefly, but noticed the same thing happened in last release of access, so I think this isn't a new issue, and we'll fix separately

@gobengo gobengo closed this as completed Dec 1, 2022
gobengo added a commit that referenced this issue Apr 11, 2023
…web3-storage/capabilities (#218)

Motivation:
* #80

To do:
* [x] initial package split
* [x] remove capabilities dir from packages/access-client and fix
imports in access-client
* [x] fix imports from other packages that were importing from
access-client/capabilities
* [x] consider splitting to `capabilities/{service}/types` not
`capabilities/types`
* decided not to unless requested (makes exports map even more
complicated, can do later)
* [x] GH actions should run tests on packages/capabilities
* [x] .github/workflows/release.yml does npm/docs jobs if paths_released
contains packages/capabilities

Co-authored-by: Irakli Gozalishvili <contact@gozala.io>
gobengo added a commit that referenced this issue Apr 11, 2023
Motivation:
*
#80 (comment)
* trying to get release-please-action to generate a release PR for
packages/capabilities
* I would have expected it in this action, but there was [an
error](https://github.com/web3-storage/w3protocol/actions/runs/3587365143/jobs/6037622712#step:2:44)
```
Expected 5 releases, only found 4
⚠ Missing 1 paths: packages/capabilities
⚠ No version for path packages/capabilities
```

Theory:
* maybe these errors are because I hadn't added this package to the
manifest?
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

No branches or pull requests

3 participants