-
Notifications
You must be signed in to change notification settings - Fork 314
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
feat(rest.packages.provider): add endpoint for Package Descriptor retrieval #4934
feat(rest.packages.provider): add endpoint for Package Descriptor retrieval #4934
Conversation
Setting this as ready for review since the only thing missing are tests at this point |
e89e70e
to
4988ad4
Compare
STILL WIP: we should at least have a dedicated request type instead of recycling InstallRequest
This comment was marked as outdated.
This comment was marked as outdated.
...deployment.agent/src/main/java/org/eclipse/kura/deployment/agent/DeploymentAgentService.java
Show resolved
Hide resolved
Please update the exported package version to 1.1.0 here https://github.com/mattdibi/kura/blob/73adee3550e2d4febf49bfe16abe7207aa4078dc/kura/org.eclipse.kura.deployment.agent/META-INF/MANIFEST.MF#L9 |
|
||
mpUrl = new URL(String.format(MARKETPLACE_URL, nodeId)); | ||
connection = (HttpsURLConnection) mpUrl.openConnection(); | ||
connection.setSSLSocketFactory(this.sslManagerService.getSSLSocketFactory()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Currently the console has a configuration property that allows to specify the SslManagerService
that is used to fetch deployment packages from the marketlplace, this change would make it use the SslManagerService configured in the deployment agent instead.. We could add another getMarketplacePackageDescriptor(String, SslManagerService)
to the DeploymentAgent that allows to specify the SslManagerService
to restore the old behaviour
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed in 08eca41
Please also update copyright headers in all changed files |
We should also update the import declarations of this package to use version range |
Addressed in d0dee4c
Addressed in d0dee4c
Addressed in 98cbbaa |
e2ccf4e
to
91545f5
Compare
Update to mockserver v 5.15.0. Newly added dependency is ✅
See: |
The backport to
To backport manually, run these commands in your terminal: # Fetch latest updates from GitHub
git fetch
# Create a new working tree
git worktree add .worktrees/backport-release-5.4.0 release-5.4.0
# Navigate to the new working tree
cd .worktrees/backport-release-5.4.0
# Create a new branch
git switch --create backport-4934-to-release-5.4.0
# Cherry-pick the merged commit of this pull request and resolve the conflicts
git cherry-pick -x --mainline 1 5b7b71cd83bbfb37209e39998bde732916586fe3
# Push it to GitHub
git push --set-upstream origin backport-4934-to-release-5.4.0
# Go back to the original working tree
cd ../..
# Delete the working tree
git worktree remove .worktrees/backport-release-5.4.0 Then, create a pull request where the |
…rieval (#4934) * feat: add MarketplacePackageDescriptor.java * feat: add barebone getMarketplacePackageDescriptor method implementation WIP * feat: add getMarketplacePackageDescriptor to DeploymentAgentService interface * feat: add isEclipseMarketplaceUrl check WIP * style: fix variable name * feat: add quick&dirty descriptor check endpoint STILL WIP: we should at least have a dedicated request type instead of recycling InstallRequest * feat: return json object * debug: add debugging log * feat: actually perform check on input url * feat: add proper Kura version retrival * refactor: move instantiation * refactor: use proper exceptions * style: add copyright header * feat: use QueryParam for passing the URL to be checked * feat: provide equals and hashCode overrides * fix: do not log user-controlled data * fix: replace character class by the character itself * test: add unit tests for MarketplacePackageDescriptor * style: add copyright header * style: refactor into gerkhin style * refactor: move given/when/then methods in their sections * refactor: use the builder for gods sake * style: add forgotten about files * test: add DeploymentRestServiceUnitTest for marketplace descriptor * refactor: move URL checks outside DeploymentAgentService to allow for testing * test: update unit tests * refactor: move method into its section * test: add integration tests * fix: remove commented out code * test: add some more tests * test: add test case for failing getMarketplacePackageDescriptor call * docs: add Javadocs for DeploymentRestService * docs: add javadocs for DeploymentAgentService * test: add DeploymentAgentTest:getMarketplacePackageDescriptor tests (#11) * ci(debug): set envvar to run testcontainers with podman * refactor: user raw Mockserver instead of going through Testcontainers * refactor: remove unnecessary dependencies * ci: roll-back changes * test: use random free port * test: add null URL test * test: reset MockServer status after each test * feat: GET -> PUT * test: GET -> PUT * refactor(web2): modify UI so that it uses the newly introduced method * build: downgrade mockserver 5.15.0 -> 5.14.0 * build: I'm a dum dum * docs: add "since" annotation for newly introduced method * style: update copyright headers * chore: deployment agent service version bump to 1.1.0 * feat: add method for overriding SslManagerService used to establish connection * style: restore formatting * style: update copyright headers * style: update copyright header * build: switched to mockserver v 5.15.0 * docs: remove newly added test deps from NOTICE file
…rieval [backport release-5.4.0] (#4968) feat(rest.packages.provider): add endpoint for Package Descriptor retrieval (#4934) * feat: add MarketplacePackageDescriptor.java * feat: add barebone getMarketplacePackageDescriptor method implementation WIP * feat: add getMarketplacePackageDescriptor to DeploymentAgentService interface * feat: add isEclipseMarketplaceUrl check WIP * style: fix variable name * feat: add quick&dirty descriptor check endpoint STILL WIP: we should at least have a dedicated request type instead of recycling InstallRequest * feat: return json object * debug: add debugging log * feat: actually perform check on input url * feat: add proper Kura version retrival * refactor: move instantiation * refactor: use proper exceptions * style: add copyright header * feat: use QueryParam for passing the URL to be checked * feat: provide equals and hashCode overrides * fix: do not log user-controlled data * fix: replace character class by the character itself * test: add unit tests for MarketplacePackageDescriptor * style: add copyright header * style: refactor into gerkhin style * refactor: move given/when/then methods in their sections * refactor: use the builder for gods sake * style: add forgotten about files * test: add DeploymentRestServiceUnitTest for marketplace descriptor * refactor: move URL checks outside DeploymentAgentService to allow for testing * test: update unit tests * refactor: move method into its section * test: add integration tests * fix: remove commented out code * test: add some more tests * test: add test case for failing getMarketplacePackageDescriptor call * docs: add Javadocs for DeploymentRestService * docs: add javadocs for DeploymentAgentService * test: add DeploymentAgentTest:getMarketplacePackageDescriptor tests (#11) * ci(debug): set envvar to run testcontainers with podman * refactor: user raw Mockserver instead of going through Testcontainers * refactor: remove unnecessary dependencies * ci: roll-back changes * test: use random free port * test: add null URL test * test: reset MockServer status after each test * feat: GET -> PUT * test: GET -> PUT * refactor(web2): modify UI so that it uses the newly introduced method * build: downgrade mockserver 5.15.0 -> 5.14.0 * build: I'm a dum dum * docs: add "since" annotation for newly introduced method * style: update copyright headers * chore: deployment agent service version bump to 1.1.0 * feat: add method for overriding SslManagerService used to establish connection * style: restore formatting * style: update copyright headers * style: update copyright header * build: switched to mockserver v 5.15.0 * docs: remove newly added test deps from NOTICE file
This PR follows #4894 and adds the endpoint for Eclipse Marketplace's Package Descriptor retrieval.
Can be tested using:
and then:
Roadmap:
deploy/v2
in its current form (feat(rest.packages.provider): adddeploy/v2
Rest API #4868)multipart/form-data
(feat(rest.packages.provider): add endpoint for.dp
upload #4894)install
endpoint (feat(rest.packages.provider): add endpoint for Package Descriptor retrieval #4934)Changelog
I mainly repurposed the code in:
Creating a new POJO (i.e.
MarketplacePackageDescriptor
) for representing the info contained in the downloaded descriptor and basically using everything in therest.packages.provider
.