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

Store and send missing fields in extension metadata #434

Merged
merged 1 commit into from
May 15, 2022

Conversation

amvanbaren
Copy link
Contributor

Fixes #330

Testing steps

  • Run in Gitpod, wait until the test extensions are published
  • Using psql, query:
SELECT name, published_date, last_updated_date FROM extension;

The published_date and last_updated_date columns should have timestamp values.

  • Call the /extensionquery endpoint:
curl --location --request POST 'http://localhost:8080/vscode/gallery/extensionquery' \
--header 'Content-Type: application/json' \
--data-raw '{"filters":[{"criteria":[{"filterType":7,"value":"redhat.vscode-yaml"},{"filterType":8,"value":"Microsoft.VisualStudio.Code"},{"filterType":12,"value":"4096"}],"pageNumber":1,"pageSize":1,"sortBy":0,"sortOrder":0}],"assetTypes":[],"flags":950}'

The response should contain releaseDate, publishedDate and lastUpdated fields

  • Publish another version of redhat.vscode-yaml. The lastUpdated / last_updated_date should be updated to current timestamp.
  • To test the migration you can use psql to revert the migration:
DELETE FROM flyway_schema_history WHERE version = '1.22';
ALTER TABLE extension DROP COLUMN published_date;
ALTER TABLE extension DROP COLUMN last_updated_date;

Restart the server. Once the server is running you can check that published_date and last_updated_date columns are added and have timestamp values, using psql:

SELECT name, published_date, last_updated_date FROM extension;

@amvanbaren amvanbaren self-assigned this Mar 22, 2022
@@ -130,6 +131,7 @@ private ExtensionVersion createExtensionVersion(ExtensionProcessor processor, Us
}
}

extension.setLastUpdatedDate(extVersion.getTimestamp());
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Are there other events where setLastUpdatedDate should be called, e.g. extension activated/deactivated or version removed?

@jeanp413
Copy link
Contributor

@amvanbaren is this ready for review? if so @filiptronicek could you take a look

# Conflicts:
#	server/src/main/java/org/eclipse/openvsx/ExtensionService.java
#	server/src/main/java/org/eclipse/openvsx/adapter/VSCodeAdapter.java
#	server/src/main/java/org/eclipse/openvsx/dto/ExtensionDTO.java
#	server/src/main/java/org/eclipse/openvsx/entities/Extension.java
#	server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/Extension.java
#	server/src/main/jooq-gen/org/eclipse/openvsx/jooq/tables/records/ExtensionRecord.java
#	server/src/test/java/org/eclipse/openvsx/RegistryAPITest.java
#	server/src/test/java/org/eclipse/openvsx/adapter/VSCodeAdapterTest.java
@amvanbaren
Copy link
Contributor Author

Yes, it's ready for review. @filiptronicek can you take a look?

Copy link
Member

@filiptronicek filiptronicek left a comment

Choose a reason for hiding this comment

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

Tried and compared the API responses, LGTM ✅

image

Tried in VS Code as well, so should be all good :)
image

@amvanbaren amvanbaren merged commit 711475b into eclipse:master May 15, 2022
amvanbaren added a commit to EclipseFdn/open-vsx.org that referenced this pull request May 22, 2022
eclipse/openvsx#457
eclipse/openvsx#434
eclipse/openvsx#429
eclipse/openvsx#443
eclipse/openvsx#435
eclipse/openvsx#442
eclipse/openvsx#406
eclipse/openvsx#433
eclipse/openvsx#424
[feat: Add support for X-Forwarded-Prefix](eclipse/openvsx@ea2cde9)
eclipse/openvsx#419
eclipse/openvsx#421
eclipse/openvsx#422
eclipse/openvsx#410

Dependabot updates:
[Bump ajv from 6.12.2 to 6.12.6 in /webui](eclipse/openvsx@f475efa)
[Bump follow-redirects from 1.14.7 to 1.14.8 in /cli](eclipse/openvsx@4f8445c)
[Bump pathval from 1.1.0 to 1.1.1 in /webui](eclipse/openvsx@a477256)
[Bump simple-get from 3.1.0 to 3.1.1 in /cli](eclipse/openvsx@2a2d537)
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.

Store and send missing fields in extension metadata
3 participants