-
Notifications
You must be signed in to change notification settings - Fork 332
feat: adding changes feed api #1859
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
Open
gnugomez
wants to merge
7
commits into
eclipse-openvsx:main
Choose a base branch
from
gnugomez:gnugomez/main/changes-feed-api
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
7 commits
Select commit
Hold shift + click to select a range
170be9b
feat: adding changes feed api
gnugomez ea8c7eb
fix: initialize lastUpdated on ExtensionVersion
gnugomez e92c13d
test: fix failing tests
gnugomez 1b69cee
feat(changes): use uppercase for state enum values
gnugomez 5791dfa
refactor(changes): centralize active/state/lastUpdated mapping in toE…
gnugomez 246de4e
fix(entities): reject state transitions away from DELETED
gnugomez 7d8ad74
fix(repo): project active/state/lastUpdated in remaining version selects
gnugomez File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
106 changes: 106 additions & 0 deletions
106
server/src/main/java/org/eclipse/openvsx/json/ChangeEntryJson.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,106 @@ | ||
| /******************************************************************************** | ||
| * Copyright (c) 2026 Eclipse Foundation and others | ||
| * | ||
| * This program and the accompanying materials are made available under the | ||
| * terms of the Eclipse Public License v. 2.0 which is available at | ||
| * http://www.eclipse.org/legal/epl-2.0. | ||
| * | ||
| * SPDX-License-Identifier: EPL-2.0 | ||
| ********************************************************************************/ | ||
| package org.eclipse.openvsx.json; | ||
|
|
||
| import com.fasterxml.jackson.annotation.JsonInclude; | ||
| import io.swagger.v3.oas.annotations.media.Schema; | ||
|
|
||
| @Schema(name = "ChangeEntry", description = "A single registry change entry") | ||
| @JsonInclude(JsonInclude.Include.NON_NULL) | ||
| public class ChangeEntryJson { | ||
|
|
||
| @Schema(description = "Namespace of the extension") | ||
| private String namespace; | ||
|
|
||
| @Schema(description = "Name of the extension") | ||
| private String name; | ||
|
|
||
| @Schema(description = "Version string") | ||
| private String version; | ||
|
|
||
| @Schema(description = "Target platform (e.g. universal, linux-x64)") | ||
| private String targetPlatform; | ||
|
|
||
| @Schema(description = "Current state of this extension version (active, inactive, deleted)") | ||
| private String state; | ||
|
|
||
| @Schema(description = "Timestamp of the version publication (ISO-8601 UTC)") | ||
| private String timestamp; | ||
|
|
||
| @Schema(description = "Timestamp of the last state change (ISO-8601 UTC)") | ||
| private String lastUpdated; | ||
|
|
||
| @Schema(description = "Full extension metadata") | ||
| private ExtensionJson extension; | ||
|
|
||
| public String getNamespace() { | ||
| return namespace; | ||
| } | ||
|
|
||
| public void setNamespace(String namespace) { | ||
| this.namespace = namespace; | ||
| } | ||
|
|
||
| public String getName() { | ||
| return name; | ||
| } | ||
|
|
||
| public void setName(String name) { | ||
| this.name = name; | ||
| } | ||
|
|
||
| public String getVersion() { | ||
| return version; | ||
| } | ||
|
|
||
| public void setVersion(String version) { | ||
| this.version = version; | ||
| } | ||
|
|
||
| public String getTargetPlatform() { | ||
| return targetPlatform; | ||
| } | ||
|
|
||
| public void setTargetPlatform(String targetPlatform) { | ||
| this.targetPlatform = targetPlatform; | ||
| } | ||
|
|
||
| public String getState() { | ||
| return state; | ||
| } | ||
|
|
||
| public void setState(String state) { | ||
| this.state = state; | ||
| } | ||
|
|
||
| public String getTimestamp() { | ||
| return timestamp; | ||
| } | ||
|
|
||
| public void setTimestamp(String timestamp) { | ||
| this.timestamp = timestamp; | ||
| } | ||
|
|
||
| public String getLastUpdated() { | ||
| return lastUpdated; | ||
| } | ||
|
|
||
| public void setLastUpdated(String lastUpdated) { | ||
| this.lastUpdated = lastUpdated; | ||
| } | ||
|
|
||
| public ExtensionJson getExtension() { | ||
| return extension; | ||
| } | ||
|
|
||
| public void setExtension(ExtensionJson extension) { | ||
| this.extension = extension; | ||
| } | ||
| } |
66 changes: 66 additions & 0 deletions
66
server/src/main/java/org/eclipse/openvsx/json/ChangesResultJson.java
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,66 @@ | ||
| /******************************************************************************** | ||
| * Copyright (c) 2026 Eclipse Foundation and others | ||
| * | ||
| * This program and the accompanying materials are made available under the | ||
| * terms of the Eclipse Public License v. 2.0 which is available at | ||
| * http://www.eclipse.org/legal/epl-2.0. | ||
| * | ||
| * SPDX-License-Identifier: EPL-2.0 | ||
| ********************************************************************************/ | ||
| package org.eclipse.openvsx.json; | ||
|
|
||
| import com.fasterxml.jackson.annotation.JsonInclude; | ||
| import io.swagger.v3.oas.annotations.media.Schema; | ||
| import jakarta.validation.constraints.Min; | ||
| import jakarta.validation.constraints.NotNull; | ||
|
|
||
| import java.util.List; | ||
|
|
||
| @Schema(name = "ChangesResult", description = "Paginated list of registry changes") | ||
| @JsonInclude(JsonInclude.Include.NON_NULL) | ||
| public class ChangesResultJson extends ResultJson { | ||
|
|
||
| public static ChangesResultJson error(String message) { | ||
| var result = new ChangesResultJson(); | ||
| result.setError(message); | ||
| return result; | ||
| } | ||
|
|
||
| @Schema(description = "Number of skipped entries according to the changes request") | ||
| @NotNull | ||
| @Min(0) | ||
| private int offset; | ||
|
|
||
| @Schema(description = "Total number of changes matching the request") | ||
| @NotNull | ||
| @Min(0) | ||
| private int totalSize; | ||
|
|
||
| @Schema(description = "List of change entries, limited to the size specified in the request") | ||
| @NotNull | ||
| private List<ChangeEntryJson> changes; | ||
|
|
||
| public int getOffset() { | ||
| return offset; | ||
| } | ||
|
|
||
| public void setOffset(int offset) { | ||
| this.offset = offset; | ||
| } | ||
|
|
||
| public int getTotalSize() { | ||
| return totalSize; | ||
| } | ||
|
|
||
| public void setTotalSize(int totalSize) { | ||
| this.totalSize = totalSize; | ||
| } | ||
|
|
||
| public List<ChangeEntryJson> getChanges() { | ||
| return changes; | ||
| } | ||
|
|
||
| public void setChanges(List<ChangeEntryJson> changes) { | ||
| this.changes = changes; | ||
| } | ||
| } |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.