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

Fix package browsing #29

Merged
merged 6 commits into from
Mar 9, 2017
Merged

Fix package browsing #29

merged 6 commits into from
Mar 9, 2017

Conversation

kevinemoore
Copy link
Contributor

Make the top-level of contents a group node.

Add a type-key to the top-level to make it a “GROUP” node to fix
package browsing.
@kevinemoore
Copy link
Contributor Author

True, we could do that, but we'd break existing packages. Are we still early enough that that's a better option?

@dimaryaz
Copy link
Contributor

dimaryaz commented Mar 9, 2017

Probably fine to break... Though you could do both, and add a TODO to remove the code that adds the key when reading the package.

@kevinemoore kevinemoore requested review from dimaryaz and removed request for dimaryaz March 9, 2017 04:56
@@ -315,6 +316,7 @@ def _add_to_contents(self, fullname, objhash, ext, path, target):
leaf = ipath.pop()

ptr = contents
ptr.setdefault(TYPE_KEY, NodeType.GROUP.value)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not just make sure get_contents always returns a dict with the key? If the package doesn't have any objects, this won't run, right?

@@ -129,6 +129,8 @@ def get_contents(self):
try:
with open(self._path, 'r') as contents_file:
contents = json.load(contents_file)
# Make the top-level a GROUP node
contents[TYPE_KEY] = NodeType.GROUP.value
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just move this to the end of the function, before return - I think that should take care of everything?

Copy link
Contributor

@dimaryaz dimaryaz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks fine - just remove the no-longer-needed (I think?) call further down.

@@ -315,6 +316,7 @@ def _add_to_contents(self, fullname, objhash, ext, path, target):
leaf = ipath.pop()

ptr = contents
ptr.setdefault(TYPE_KEY, NodeType.GROUP.value)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is unnecessary now, right?

@kevinemoore kevinemoore merged commit ec3c4c5 into master Mar 9, 2017
@kevinemoore kevinemoore deleted the top-level-group-node branch March 9, 2017 18:24
dimaryaz added a commit that referenced this pull request Nov 12, 2017
nl0 pushed a commit that referenced this pull request Dec 7, 2019
nl0 pushed a commit that referenced this pull request Dec 9, 2019
nl0 added a commit that referenced this pull request Dec 9, 2019
* master:
  Update dependency vega to ^5.9.0 (#34)
  Update babel monorepo to ^7.7.5 (#31)
  Update dependency eslint-plugin-redux-saga to ^1.1.3 (#32)
  Update dependency terser-webpack-plugin to ^1.4.2 (#33)
  Update dependency @sentry/browser to ^5.10.1 (#27)
  Update dependency fetch-mock to ^8.0.1 (#28)
  Update dependency use-debounce to ^3.3.0 (#29)
  Update dependency react-app-polyfill to ^1.0.5 (#30)
  Update mui monorepo to ^4.7.1 (#25)
  Update dependency css-loader to ^3.2.1 (#21)
  Update dependency use-debounce to ^3.2.0 (#24)
  Update dependency eslint to ^6.7.2 (#22)
  Update dependency eslint-plugin-react to ^7.17.0 (#23)
  Update dependency aws-sdk to ^2.582.0 (#1)
  Update dependency style-loader to ^1.0.1
  Update dependency lint-staged to ^9.5.0
  Update dependency coveralls to ^3.0.9
  Update dependency connected-react-router to ^6.6.1
  Update renovate.json
nl0 added a commit that referenced this pull request Dec 11, 2019
* master: (48 commits)
  Better package list ux pt. 1: larger hit area (whole tile) (#1439)
  Fix interrupted downloads causing corrupted manifests (#1438)
  Fixed missing @ for decorator (#1441)
  PyPi improvements - VERSION file and CircleCi support for alpha releases (#1427)
  Fix Telemetry double counting (#1426)
  preview bio files as plain text (#1435)
  Link to open data (#1434)
  Update dependency @material-ui/core to ^4.7.2 (#37)
  Update dependency @babel/preset-env to ^7.7.6 (#38)
  Update dependency eslint-import-resolver-webpack to ^0.12.0 (#39)
  Update dependency vega to ^5.9.0 (#34)
  Update babel monorepo to ^7.7.5 (#31)
  Update dependency eslint-plugin-redux-saga to ^1.1.3 (#32)
  Update dependency terser-webpack-plugin to ^1.4.2 (#33)
  Update dependency @sentry/browser to ^5.10.1 (#27)
  Update dependency fetch-mock to ^8.0.1 (#28)
  Update dependency use-debounce to ^3.3.0 (#29)
  Update dependency react-app-polyfill to ^1.0.5 (#30)
  Update mui monorepo to ^4.7.1 (#25)
  Update dependency css-loader to ^3.2.1 (#21)
  ...
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