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

Add VSCode extension repos #1427

Closed
wants to merge 2 commits into from

Conversation

Pandapip1
Copy link
Contributor

No description provided.

@Pandapip1 Pandapip1 marked this pull request as ready for review September 11, 2024 21:39
@Pandapip1 Pandapip1 force-pushed the add-vscode-repos branch 6 times, most recently from e4846cf to 857e61e Compare September 11, 2024 22:22
@Pandapip1
Copy link
Contributor Author

I haven't tested this; I'm not sure if there are any steps I'm missing (maybe some unit and integration tests?).

Copy link
Member

@AMDmi3 AMDmi3 left a comment

Choose a reason for hiding this comment

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

There are 2 repositories, please split into separate PRs.
openvsx almost works and looks useful, as it intersects with vscode-extension-* from nix
ragarding vscmarketplace I'm hesitant as I'd prefer not to have any complex and/or paginating fetchers ever

class OpenVSXParser(Parser):
def iter_parse(self, path: str, factory: PackageFactory) -> Iterable[PackageMaker]:
with open(path, 'r') as extdatafile:
extension_data = json.load(extdatafile)
Copy link
Member

Choose a reason for hiding this comment

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

Loading json into memory is not scalable. You should use iter_json_list to parse it as stream.

# TODO: More metadata is available, it's just harder to fetch and will require its own fetcher, in all likelihood
pkg.add_name('vscode-extension:{namespace}-{name}'.format(**extension), NameType.GENERIC_SRC_NAME)
pkg.set_version(extension['version'])
pkg.set_summary(extension['description'])
Copy link
Member

Choose a reason for hiding this comment

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

Description turns out to be optional, thus extension.get('description')

for extension in raw_extensions:
with factory.begin() as pkg:
# TODO: More metadata is available, it's just harder to fetch and will require its own fetcher, in all likelihood
pkg.add_name('vscode-extension:{namespace}-{name}'.format(**extension), NameType.GENERIC_SRC_NAME)
Copy link
Member

Choose a reason for hiding this comment

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

vscode-extension: prefix should be added in a ruleset (and we can shorten it to vscode:). Also please use f-strings with defined fields.

pkg.set_version(extension['version'])
pkg.set_summary(extension['description'])
pkg.add_maintainers('{namespace}@openvsx'.format(**extension))
pkg.add_links(LinkType.UPSTREAM_HOMEPAGE, 'https://open-vsx.org/extension/{namespace}/{name}'.format(**extension))
Copy link
Member

Choose a reason for hiding this comment

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

  • f-strings with explicit extension fields here and around
  • generated links are defined in packagelinks section of repo config. You can pass namespace/name through pkg.extrafields
  • link type would be PROJECT_HOMEPAGE, it's not upstream

if len(response['results'][0]['extensions']) < self.page_size:
break

with open(statefile.get_path(), 'w', encoding='utf-8') as extdata:
Copy link
Member

Choose a reason for hiding this comment

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

You write directly into statefile.get_file() here

AMDmi3 added a commit to repology/repology-rules that referenced this pull request Sep 23, 2024
@AMDmi3
Copy link
Member

AMDmi3 commented Sep 23, 2024

Timeout. I've polished and merged openvsx support, vscmarketplace doesn't look suitable. Feel free to redo in compatible way if possible.

@AMDmi3 AMDmi3 closed this Sep 23, 2024
AMDmi3 added a commit that referenced this pull request Sep 23, 2024
- Fix parser to use standard json processing facility
- Fix handling optional fields (download, description
- Fix package link types and add another link (recipe/manifest)
- Improbe name handling, handle display name properly
- Move repository entry into modules/ fix type, update minpackages,
  enable shadow
@Pandapip1 Pandapip1 deleted the add-vscode-repos branch September 23, 2024 21:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants