Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

feat: pin API #1045

Merged
merged 21 commits into from
Jun 19, 2018
Merged

feat: pin API #1045

merged 21 commits into from
Jun 19, 2018

Commits on Jun 18, 2018

  1. feat: jsipfs pin improvements (#1249)

    * initial sweep through to understand how pin works. Did make some changes but mostly minor.
    
    * refactor pb schema to it's own file
    
    * fix: don't pin files during files.add if opts.pin === false
    
    * feat: add some http qs parsing, http route/resources cleanup, cleanup core/utils.parseIpfsPath
    
    * feat: expand pin tests. \nFirst draft. still needs some further work.
    
    * feat: Add logging for entry/exit of pins: add/rm/flush/load. Clean some documentation.
    
    * feat: add --pin to files.add, fix: improper pin option parsing in core.
    
    * feat: Use ipfs.files.add to add init-docs instead of directly using the unix-fs importer.
    
    * feat(tests): Add tests for cli --pin option. I know this should be more of an integration test. Should be written in /core. Maybe talk with Victor about testing different layers
    
    * feat: use isIPFS to valiate a multihash.
    JonKrone committed Jun 18, 2018
    Configuration menu
    Copy the full SHA
    0662cd8 View commit details
    Browse the repository at this point in the history
  2. revert: default assets are not added when running on a browser

    refactor: change pin.flush logging message
    JonKrone committed Jun 18, 2018
    Configuration menu
    Copy the full SHA
    ee813eb View commit details
    Browse the repository at this point in the history
  3. feat(test): add tests for failure cases of normalizeHashes

    fix: don't need to cast the object.get result with toJSON
    
    revert: use interface-datastore.Key for datastore pin storage
    The proper change would be that datastore-level automatically casts operations into Keys
    
    fix: do not invoke callback within a try/catch
    
    feat(test): make cli pin tests more robust
    By using files that aren't added on IPFS initialization. Still needs work on files.rm (direct) and ipfs ls (indirect).
    
    fix: remove commented code, traced test failures to pin-set
    Got to go for the night, though, so will checkpoint here and address tomorrow.
    
    feat: parseIpfsPath now throws errors for consistency
    
    feat: resolveIpfsPaths error message lists the relative path that failed
    
    feat: use follow.bind instead of mutating the links
    Also decided not show relative paths. Less human friendly but probably cleaner otherwise.
    
    refactor: resolveIpfsPaths -> resolvePaths
    
    feat: promisify resolvePaths
    
    test: change parseIpfsPath failure tests to use try/catch
    
    docs: edit resolvePath doc
    
    revert: accidentally deleted commands/pin.js
    JonKrone committed Jun 18, 2018
    Configuration menu
    Copy the full SHA
    f847f98 View commit details
    Browse the repository at this point in the history
  4. fix: add some changes missed during rebase, syntax fixes, etc

    I think my original rebase for this branch 2 weeks ago might have
    changed history for the intervening commits, indirectly causing some of
    these missed changes. or I just rebase onto the wrong oldparent.
    
    fix: some onlyHash and pin tests broke after merging
    onlyHash and pin interact: shouldn't pin when --only-hash.
    
    fix: trim output for 'pin ls when no hash is passed'
    
    test: indirect pins supersede direct pins: turns out we had a bug
    
    feat: add expectTimeout test utility
    
    feat: promisify some additional pin utils
    JonKrone committed Jun 18, 2018
    Configuration menu
    Copy the full SHA
    be8747e View commit details
    Browse the repository at this point in the history
  5. test: initial work testing the core/pin.js implementation

    I think I'll end up moving most tests here.
    
    test: add tests for pin.ls and pin.rm
    Based tests on other pin fixtures, need to migrate the isPinned* tests to them as well.
    
    fix: direct pins are now deleted by a default pin.rm(hash)
    
    test: prepare for pin.add tests
    'indirect supersedes direct' test exposes a bug in pin.ls
    
    feat: switch away from multihashes for isPinned* tests
    
    test: impl pin.add tests
    
    fix: add fixture files only once
    
    test: add test for a potential bug, clean isPinned* tests
    
    refactor: remove a test that's no longer needed
    
    fix: pin.ls, indirect pins should supersede direct pins
    
    test: naive pin.load, pin.flush tests
    
    feat: remove most pin cli tests as functionality is tested in pin core tests
    
    refactor: rename solarSystem
    JonKrone committed Jun 18, 2018
    Configuration menu
    Copy the full SHA
    beead9a View commit details
    Browse the repository at this point in the history
  6. refactor: move pin http-api tests to http-api/inject

    fix: attempt to find a way to use http-api/inject test structure for pin tests
    
    test: fix pin.rm http-api tests
    
    test: fix pin.add http-api tests
    
    docs: docs and cleanup of http-api pin tests
    
    refactor: renaming
    
    fix: lint errors
    
    fix: resolvePaths tests are failing on CI, it might be long ops, testing a timeout bump
    
    fix: add files explicitly before testing resolvePaths
    
    fix: remove mocha.only from resolvePaths. let's hope tests pass, they are passing CI now
    
    fix: rename test/core/utils.spec.js -> utils.js so it's not run during browser tests
    JonKrone committed Jun 18, 2018
    Configuration menu
    Copy the full SHA
    868570a View commit details
    Browse the repository at this point in the history
  7. test: first draft of pin-set tests

    Need to leave computer, this is a checkpoint.
    
    test: add sanity test for walkItems and hasChild, clean others
    These tests are more descriptive than really pushing the impl. I'd love others' thoughts on what else should be hit and how. I also need to compare go's pinset impl against ours
    
    fix: stop daemons
    
    feat: documentation and multihash buffer handling for dag.get
    
    fix: lint
    JonKrone committed Jun 18, 2018
    Configuration menu
    Copy the full SHA
    066c113 View commit details
    Browse the repository at this point in the history
  8. Configuration menu
    Copy the full SHA
    90dad57 View commit details
    Browse the repository at this point in the history
  9. feat: rename vars, fix _depth default value, add docs

    fix: pinset.hasChild buffer check
    
    feat: hardcode expected length for flush/load tests
    JonKrone committed Jun 18, 2018
    Configuration menu
    Copy the full SHA
    17b81ea View commit details
    Browse the repository at this point in the history
  10. Configuration menu
    Copy the full SHA
    753f618 View commit details
    Browse the repository at this point in the history
  11. Configuration menu
    Copy the full SHA
    92b3d2f View commit details
    Browse the repository at this point in the history
  12. fix: re-add pin interface tests

    I must have missed a commit during a rebase.
    JonKrone committed Jun 18, 2018
    Configuration menu
    Copy the full SHA
    a5c556c View commit details
    Browse the repository at this point in the history
  13. fix: lint

    JonKrone committed Jun 18, 2018
    Configuration menu
    Copy the full SHA
    8f7de05 View commit details
    Browse the repository at this point in the history
  14. Configuration menu
    Copy the full SHA
    408d2bc View commit details
    Browse the repository at this point in the history
  15. chore: rebase a month of changes, resolve minor issues from that

    fix: yarg arugment naming for pin cli commands
    
    fix: convert file multihashes to a b58 string
    
    fix: another way of checking for CID-ness
    
    fix: lint
    
    fix: toB58String handles non-buffers
    
    fix: key-exchange core tests now shutdown daemon.
    JonKrone committed Jun 18, 2018
    Configuration menu
    Copy the full SHA
    f77a379 View commit details
    Browse the repository at this point in the history
  16. chore: update big.js version

    JonKrone committed Jun 18, 2018
    Configuration menu
    Copy the full SHA
    e3013ee View commit details
    Browse the repository at this point in the history
  17. Configuration menu
    Copy the full SHA
    6c29a3d View commit details
    Browse the repository at this point in the history
  18. Configuration menu
    Copy the full SHA
    a1b9b93 View commit details
    Browse the repository at this point in the history
  19. refactor: use lodash.flattenDeep

    refactor: pinset.hasChild -> pinset.hasDescendent
    
    fix: invoke someCb if we've seen the hash before
    
    refactor: async patterns in dag._getRecursive
    
    refactor: pinset.hasDescendant
    
    refactor: pinset.storeItems async patterns
    
    refactor: pinset.loadSet and pin.walkItem async patterns
    
    docs: add link to go-ipfs' fanout bin implementation
    
    refactor: async patterns of pin.load/flush
    
    refactor: lint
    
    refactor: privatize internal pin key storage
    
    refactor: change encapsulation of ipfs.pin, fix resulting issues
    
    fix: lint
    
    fix: 'files add --pin=false' test was giving a false positive
    
    refactor: use is-ipfs to check CID-ability of a string
    
    refactor: remove last instance of 'once' in the pin code
    JonKrone committed Jun 18, 2018
    Configuration menu
    Copy the full SHA
    10f40ca View commit details
    Browse the repository at this point in the history
  20. refactor: do not expose pinTypes

    They're simple enough, documented elsewhere, and not used by any exposed functionality.
    JonKrone committed Jun 18, 2018
    Configuration menu
    Copy the full SHA
    a7a55b9 View commit details
    Browse the repository at this point in the history
  21. Configuration menu
    Copy the full SHA
    d0b4a0c View commit details
    Browse the repository at this point in the history