You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@openwhisk.apache.org by GitBox <gi...@apache.org> on 2022/11/08 18:05:32 UTC

[GitHub] [openwhisk] bdoyle0182 opened a new pull request, #5351: Add cors headers to components' server admin routes

bdoyle0182 opened a new pull request, #5351:
URL: https://github.com/apache/openwhisk/pull/5351

   ## Description
   This pr adds cors headers to the server admin routes of each component plus the options route which is needed for pre-flight requests from browsers when auth is included in the request. The reason for this is to lay the ground work for future ui work for an admin portal.
   
   ## Related issue and scope
   - [ ] I opened an issue to propose and discuss this change (#????)
   
   ## My changes affect the following components
   - [ ] API
   - [X] Controller
   - [ ] Message Bus (e.g., Kafka)
   - [ ] Loadbalancer
   - [X] Scheduler
   - [X] Invoker
   - [ ] Intrinsic actions (e.g., sequences, conductors)
   - [ ] Data stores (e.g., CouchDB)
   - [ ] Tests
   - [ ] Deployment
   - [ ] CLI
   - [ ] General tooling
   - [ ] Documentation
   
   ## Types of changes
   - [ ] Bug fix (generally a non-breaking change which closes an issue).
   - [X] Enhancement or new feature (adds new functionality).
   - [ ] Breaking change (a bug fix or enhancement which changes existing behavior).
   
   ## Checklist:
   - [X] I signed an [Apache CLA](https://github.com/apache/openwhisk/blob/master/CONTRIBUTING.md).
   - [X] I reviewed the [style guides](https://github.com/apache/openwhisk/blob/master/CONTRIBUTING.md#coding-standards) and followed the recommendations (Travis CI will check :).
   - [ ] I added tests to cover my changes.
   - [ ] My changes require further changes to the documentation.
   - [ ] I updated the documentation where necessary.
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@openwhisk.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [openwhisk] bdoyle0182 commented on pull request #5351: Add cors headers to components' server admin routes

Posted by GitBox <gi...@apache.org>.
bdoyle0182 commented on PR #5351:
URL: https://github.com/apache/openwhisk/pull/5351#issuecomment-1309349955

   > 
   
   Not at the moment don't have bandwidth to do any ui work, but maybe down the road


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@openwhisk.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [openwhisk] bdoyle0182 merged pull request #5351: Add cors headers to components' server admin routes

Posted by GitBox <gi...@apache.org>.
bdoyle0182 merged PR #5351:
URL: https://github.com/apache/openwhisk/pull/5351


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@openwhisk.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [openwhisk] codecov-commenter commented on pull request #5351: Add cors headers to components' server admin routes

Posted by GitBox <gi...@apache.org>.
codecov-commenter commented on PR #5351:
URL: https://github.com/apache/openwhisk/pull/5351#issuecomment-1307839453

   # [Codecov](https://codecov.io/gh/apache/openwhisk/pull/5351?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) Report
   > Merging [#5351](https://codecov.io/gh/apache/openwhisk/pull/5351?src=pr&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (af107ed) into [master](https://codecov.io/gh/apache/openwhisk/commit/44791f361d1492e985e9f1bcf3616253c77ed39d?el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) (44791f3) will **decrease** coverage by `34.29%`.
   > The diff coverage is `47.54%`.
   
   ```diff
   @@             Coverage Diff             @@
   ##           master    #5351       +/-   ##
   ===========================================
   - Coverage   81.26%   46.96%   -34.30%     
   ===========================================
     Files         240      233        -7     
     Lines       14393    14141      -252     
     Branches      603      601        -2     
   ===========================================
   - Hits        11697     6642     -5055     
   - Misses       2696     7499     +4803     
   ```
   
   
   | [Impacted Files](https://codecov.io/gh/apache/openwhisk/pull/5351?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | Coverage Δ | |
   |---|---|---|
   | [...rg/apache/openwhisk/core/controller/RestAPIs.scala](https://codecov.io/gh/apache/openwhisk/pull/5351/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y29yZS9jb250cm9sbGVyL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUvb3BlbndoaXNrL2NvcmUvY29udHJvbGxlci9SZXN0QVBJcy5zY2FsYQ==) | `67.85% <ø> (-20.24%)` | :arrow_down: |
   | [.../apache/openwhisk/core/controller/WebActions.scala](https://codecov.io/gh/apache/openwhisk/pull/5351/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y29yZS9jb250cm9sbGVyL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUvb3BlbndoaXNrL2NvcmUvY29udHJvbGxlci9XZWJBY3Rpb25zLnNjYWxh) | `6.99% <ø> (-83.96%)` | :arrow_down: |
   | [...ontainerpool/v2/FunctionPullingContainerPool.scala](https://codecov.io/gh/apache/openwhisk/pull/5351/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y29yZS9pbnZva2VyL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUvb3BlbndoaXNrL2NvcmUvY29udGFpbmVycG9vbC92Mi9GdW5jdGlvblB1bGxpbmdDb250YWluZXJQb29sLnNjYWxh) | `80.83% <ø> (ø)` | |
   | [...ntainerpool/v2/FunctionPullingContainerProxy.scala](https://codecov.io/gh/apache/openwhisk/pull/5351/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y29yZS9pbnZva2VyL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUvb3BlbndoaXNrL2NvcmUvY29udGFpbmVycG9vbC92Mi9GdW5jdGlvblB1bGxpbmdDb250YWluZXJQcm94eS5zY2FsYQ==) | `78.59% <ø> (+0.09%)` | :arrow_up: |
   | [...he/openwhisk/core/invoker/FPCInvokerReactive.scala](https://codecov.io/gh/apache/openwhisk/pull/5351/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y29yZS9pbnZva2VyL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUvb3BlbndoaXNrL2NvcmUvaW52b2tlci9GUENJbnZva2VyUmVhY3RpdmUuc2NhbGE=) | `0.00% <0.00%> (ø)` | |
   | [...ache/openwhisk/core/invoker/FPCInvokerServer.scala](https://codecov.io/gh/apache/openwhisk/pull/5351/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y29yZS9pbnZva2VyL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUvb3BlbndoaXNrL2NvcmUvaW52b2tlci9GUENJbnZva2VyU2VydmVyLnNjYWxh) | `0.00% <0.00%> (-45.84%)` | :arrow_down: |
   | [...pache/openwhisk/core/invoker/InvokerReactive.scala](https://codecov.io/gh/apache/openwhisk/pull/5351/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y29yZS9pbnZva2VyL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUvb3BlbndoaXNrL2NvcmUvaW52b2tlci9JbnZva2VyUmVhY3RpdmUuc2NhbGE=) | `53.12% <ø> (-18.75%)` | :arrow_down: |
   | [.../openwhisk/core/scheduler/FPCSchedulerServer.scala](https://codecov.io/gh/apache/openwhisk/pull/5351/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y29yZS9zY2hlZHVsZXIvc3JjL21haW4vc2NhbGEvb3JnL2FwYWNoZS9vcGVud2hpc2svY29yZS9zY2hlZHVsZXIvRlBDU2NoZWR1bGVyU2VydmVyLnNjYWxh) | `75.00% <75.00%> (-0.87%)` | :arrow_down: |
   | [.../apache/openwhisk/core/controller/Controller.scala](https://codecov.io/gh/apache/openwhisk/pull/5351/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y29yZS9jb250cm9sbGVyL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUvb3BlbndoaXNrL2NvcmUvY29udHJvbGxlci9Db250cm9sbGVyLnNjYWxh) | `71.20% <80.00%> (-12.28%)` | :arrow_down: |
   | [...scala/org/apache/openwhisk/http/CorsSettings.scala](https://codecov.io/gh/apache/openwhisk/pull/5351/diff?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation#diff-Y29tbW9uL3NjYWxhL3NyYy9tYWluL3NjYWxhL29yZy9hcGFjaGUvb3BlbndoaXNrL2h0dHAvQ29yc1NldHRpbmdzLnNjYWxh) | `100.00% <100.00%> (ø)` | |
   | ... and [173 more](https://codecov.io/gh/apache/openwhisk/pull/5351/diff?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation) | |
   
   :mega: We’re building smart automated test selection to slash your CI/CD build times. [Learn more](https://about.codecov.io/iterative-testing/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=The+Apache+Software+Foundation)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@openwhisk.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [openwhisk] bdoyle0182 commented on a diff in pull request #5351: Add cors headers to components' server admin routes

Posted by GitBox <gi...@apache.org>.
bdoyle0182 commented on code in PR #5351:
URL: https://github.com/apache/openwhisk/pull/5351#discussion_r1018400037


##########
core/invoker/src/main/scala/org/apache/openwhisk/core/containerpool/v2/FunctionPullingContainerPool.scala:
##########
@@ -78,6 +76,7 @@ case class DeletionContainer(deletionMessage: ContainerDeletionMessage)
 case object Remove
 case class Keep(timeout: FiniteDuration)
 case class PrewarmContainer(maxConcurrent: Int)
+case object GetState

Review Comment:
   I see what happened now, I had this in progress for awhile and had a bad merge somewhere with your recent commits. Should all be cleaned up now.



##########
core/invoker/src/main/scala/org/apache/openwhisk/core/containerpool/v2/FunctionPullingContainerProxy.scala:
##########
@@ -152,7 +152,6 @@ case class InitializedData(container: Container,
                            override val clientProxy: ActorRef)
     extends ContainerAvailableData(container, invocationNamespace, action)
     with WithClient {
-  override def getContainer = Some(container)

Review Comment:
   fixed



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@openwhisk.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [openwhisk] bdoyle0182 commented on a diff in pull request #5351: Add cors headers to components' server admin routes

Posted by GitBox <gi...@apache.org>.
bdoyle0182 commented on code in PR #5351:
URL: https://github.com/apache/openwhisk/pull/5351#discussion_r1016962570


##########
core/invoker/src/main/scala/org/apache/openwhisk/core/invoker/FPCInvokerReactive.scala:
##########
@@ -390,7 +390,7 @@ class FPCInvokerReactive(config: WhiskConfig,
 
   override def getPoolState(): Future[Either[NotSupportedPoolState, TotalContainerPoolState]] = {
     implicit val timeout: Timeout = 5.seconds
-    (pool ? GetState).mapTo[TotalContainerPoolState].map(Right(_))
+    (pool ? GetPoolState).mapTo[TotalContainerPoolState].map(Right(_))

Review Comment:
   I was getting a compilation error for this locally due to two `GetState` types in the repo so I aliased it for now



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@openwhisk.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


[GitHub] [openwhisk] style95 commented on a diff in pull request #5351: Add cors headers to components' server admin routes

Posted by GitBox <gi...@apache.org>.
style95 commented on code in PR #5351:
URL: https://github.com/apache/openwhisk/pull/5351#discussion_r1017294939


##########
core/invoker/src/main/scala/org/apache/openwhisk/core/containerpool/v2/FunctionPullingContainerProxy.scala:
##########
@@ -152,7 +152,6 @@ case class InitializedData(container: Container,
                            override val clientProxy: ActorRef)
     extends ContainerAvailableData(container, invocationNamespace, action)
     with WithClient {
-  override def getContainer = Some(container)

Review Comment:
   Why are these removed?



##########
core/invoker/src/main/scala/org/apache/openwhisk/core/containerpool/v2/FunctionPullingContainerPool.scala:
##########
@@ -78,6 +76,7 @@ case class DeletionContainer(deletionMessage: ContainerDeletionMessage)
 case object Remove
 case class Keep(timeout: FiniteDuration)
 case class PrewarmContainer(maxConcurrent: Int)
+case object GetState

Review Comment:
   Is there any reason we should define another `GetState` here?
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@openwhisk.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org