Giter Club home page Giter Club logo

Comments (9)

IrinaSouth avatar IrinaSouth commented on July 1, 2024 1

Hi Amanda,

Thanks for your clean and concise feedback and suggestions for changes.

We had an internal discussion and we think that most of it we can implement fairly quickly. Will be posting updates here once there is a progress.

Cheers,
Irina

from featurehub.

rvowles avatar rvowles commented on July 1, 2024 1

So a couple of initial updates on this ticket. We discussed internally that we really need the TestSDK to be identifiable when it comes in and makes changes to feature values as well, currently these are transparent and don't turn up in the history. The transitioning of this field in feature value from being nullable -> not null was a wee bit of a mission in SQL and some post cleanup jobs, so we decided to introduce the "nil UUID" user to "blame" where we don't have the appropriate records.

The code for it is sitting here at the moment: #1017

and its passing our full end to end suite (which takes about an hour and a half to run) so far, but we need to add checks to make sure the user id is being correctly picked up for the testsdk. We have modified the "get person" API call to ensure that you can also get the Test SDK user.

Unfortunately for (2), the changelog is not under our control, it is part of the underlying framework and by turning on the logger you turn it on.

(3) will come in a separate PR - we will provide an API that gives access to the historical details as usable by someone from the AdminSDK. There will likely be additions made to it when it manages to surface in the UI.

As a side note, there is a new form of message coming as part of the Slack/Teams integration work which is a diff based audit trail with more complete information that will be available and also includes fuller details. You may wish to take a look at the details being included and see if it is of interest. https://github.com/featurehub-io/featurehub/blob/main/backend/messaging-api/messaging-api.yaml

image

from featurehub.

rvowles avatar rvowles commented on July 1, 2024 1

I think its a failure in my documentation :-) You must specify the feature keys or ids that you want, and unless you are a superuser, you must also specify the environmentIds. Its all optional because you have to specify keys or ids and depending on who you are, you may or may not need to specify environments. So I need to make the API docs more clear, sorry about that!

from featurehub.

amandam11 avatar amandam11 commented on July 1, 2024

Thanks for the updates, the planned changes sound great, and very useful.

from featurehub.

amandam11 avatar amandam11 commented on July 1, 2024

@rvowles I tested 1.6.2-RC for the changes you mentioned. The webhooks are getting the person id, and I can then look that person up using the admin-sdk.

However, I failed to get the feature-version history to work.

Scenario:

  1. docker compose running party-server 1.6.1 with postgres database as per:
  2. Create features
  3. Backed up the database
  4. Stopped/removed the 1.6.1 featurehub/party-server
  5. Updated docker compose to have featurehub/party-server:1.6.2-RC
  6. Tried to get feature history - nothing back
  7. Changed an existing feature - ok
  8. Asked for feature history, nothing returned, and error in log e.g.
curl -H "Authorization: Bearer <token>" http://172.17.0.1:8085/mr-api/portfolio/48c2b04c-41dd-4299-9f6e-487a63ab7d27/application
[{"id":"94fcb3d4-d921-4945-8660-159567e0f119","name":"test","description":"test","portfolioId":"48c2b04c-41dd-4299-9f6e-487a63ab7d27","version":1,"groups":[],"features":[],"environments":[]}]

curl -H "Authorization: Bearer <token>" http://172.17.0.1:8085/mr-api/application/94fcb3d4-d921-4945-8660-159567e0f119/feature-history

and then in logs:

{"@timestamp":"2023-06-26T14:02:37.091+0000","message":"Failed jersey request","priority":"ERROR","path":"io.featurehub.jersey.config.LocalExceptionMapper","thread":"grizzly-http-server-27","stack_trace":"jakarta.ws.rs.NotFoundException: HTTP 404 Not Found\n\tio.featurehub.mr.resources.FeatureHistoryResource.listFeatureHistory(FeatureHistoryResource.kt:23) ~[mr-1.1-SNAPSHOT.jar:?]\n\tio.featurehub.mr.api.FeatureHistoryServiceDelegator.listFeatureHistory(FeatureHistoryServiceDelegator.java:44) ~[mr-api-java-server-1.1-SNAPSHOT.jar:?]\n\tjdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method) ~[?:?]\n\tjdk.internal.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) ~[?:?]\n\tjdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) ~[?:?]\n\tjava.lang.reflect.Method.invoke(Unknown Source) ~[?:?]\n\torg.glassfish.jersey.server.model.internal.ResourceMethodInvocationHandlerFactory.lambda$static$0(ResourceMethodInvocationHandlerFactory.java:52) ~[jersey-server-3.1.1.jar:?]\n\torg.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher$1.run(AbstractJavaResourceMethodDispatcher.java:134) ~[jersey-server-3.1.1.jar:?]\n\torg.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.invoke(AbstractJavaResourceMethodDispatcher.java:177) ~[jersey-server-3.1.1.jar:?]\n\torg.glassfish.jersey.server.model.internal.JavaResourceMethodDispatcherProvider$TypeOutInvoker.doDispatch(JavaResourceMethodDispatcherProvider.java:219) ~[jersey-server-3.1.1.jar:?]\n\torg.glassfish.jersey.server.model.internal.AbstractJavaResourceMethodDispatcher.dispatch(AbstractJavaResourceMethodDispatcher.java:81) ~[jersey-server-3.1.1.jar:?]\n\torg.glassfish.jersey.server.model.ResourceMethodInvoker.invoke(ResourceMethodInvoker.java:478) ~[jersey-server-3.1.1.jar:?]\n\torg.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:400) ~[jersey-server-3.1.1.jar:?]\n\torg.glassfish.jersey.server.model.ResourceMethodInvoker.apply(ResourceMethodInvoker.java:81) ~[jersey-server-3.1.1.jar:?]\n\torg.glassfish.jersey.server.ServerRuntime$1.run(ServerRuntime.java:261) [jersey-server-3.1.1.jar:?]\n\torg.glassfish.jersey.internal.Errors$1.call(Errors.java:248) [jersey-common-3.1.1.jar:?]\n\torg.glassfish.jersey.internal.Errors$1.call(Errors.java:244) [jersey-common-3.1.1.jar:?]\n\torg.glassfish.jersey.internal.Errors.process(Errors.java:292) [jersey-common-3.1.1.jar:?]\n\torg.glassfish.jersey.internal.Errors.process(Errors.java:274) [jersey-common-3.1.1.jar:?]\n\torg.glassfish.jersey.internal.Errors.process(Errors.java:244) [jersey-common-3.1.1.jar:?]\n\torg.glassfish.jersey.process.internal.RequestScope.runInScope(RequestScope.java:265) [jersey-common-3.1.1.jar:?]\n\torg.glassfish.jersey.server.ServerRuntime.process(ServerRuntime.java:240) [jersey-server-3.1.1.jar:?]\n\torg.glassfish.jersey.server.ApplicationHandler.handle(ApplicationHandler.java:697) [jersey-server-3.1.1.jar:?]\n\torg.glassfish.jersey.grizzly2.httpserver.GrizzlyHttpContainer.service(GrizzlyHttpContainer.java:367) [jersey-container-grizzly2-http-3.1.1.jar:?]\n\torg.glassfish.grizzly.http.server.HttpHandler$1.run(HttpHandler.java:190) [grizzly-http-server-4.0.0.jar:4.0.0]\n\torg.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.doWork(AbstractThreadPool.java:535) [grizzly-framework-4.0.0.jar:4.0.0]\n\torg.glassfish.grizzly.threadpool.AbstractThreadPool$Worker.run(AbstractThreadPool.java:515) [grizzly-framework-4.0.0.jar:4.0.0]\n\tjava.lang.Thread.run(Unknown Source) [?:?]","host":"featurehub","user":{"email":"[email protected]","id":"8cb65eb8-d608-408f-9068-49a074553508"}}
  1. Created a new application, created a numeric feature, set feature value, and then tried to get feature-history on the new application. But still got the same response.
    Used the application and all-feature-environment to verify I'd got application correct:
$curl -H "Authorization: Bearer <token>" http://172.17.0.1:8085/mr-api/application/cdf517be-4c1a-4a48-a8cc-1f6a5a1d4eb4/feature-history

$ curl -H "Authorization: Bearer <token>" http://172.17.0.1:8085/mr-api/application/cdf517be-4c1a-4a48-a8cc-1f6a5a1d4eb4
{"id":"cdf517be-4c1a-4a48-a8cc-1f6a5a1d4eb4","name":"test2","description":"test2","portfolioId":"48c2b04c-41dd-4299-9f6e-487a63ab7d27","version":1,"groups":[],"features":[],"environments":[]}

$ curl -H "Authorization: Bearer <token>" http://172.17.0.1:8085/mr-api/application/cdf517be-4c1a-4a48-a8cc-1f6a5a1d4eb4/all-feature-environment
{"applicationId":"cdf517be-4c1a-4a48-a8cc-1f6a5a1d4eb4","features":[{"id":"8dc0f585-6faf-4a9c-bdb9-debe51f7ee4a","key":"testkey1","alias":"","link":"","name":"testkey1","valueType":"NUMBER","version":1,"secret":false,"description":""}],"environments":[{"environmentId":"1bbee531-a713-4977-b078-739f6c4f2e25","environmentName":"production","features":[{"id":"a80db821-3ef7-4089-819a-fb2e0cc44ebc","key":"testkey1","locked":false,"valueNumber":3,"retired":false,"rolloutStrategyInstances":[],"rolloutStrategies":[],"sharedRolloutStrategies":[],"environmentId":"1bbee531-a713-4977-b078-739f6c4f2e25","version":1,"whoUpdated":{"id":{"id":"1c7f8dbd-01f1-4796-9064-000d6816812b"},"name":"Amanda","email":"[email protected]","personType":"person","version":2,"passwordRequiresReset":false,"additional":[]},"whenUpdated":"2023-06-26T14:08:37.246Z"}],"roles":["READ","LOCK","UNLOCK","CHANGE_VALUE"]}],"maxFeatures":1}

Am I mis-understanding how the feature-history call works, but all the parameters appeared to be optional.

from featurehub.

amandam11 avatar amandam11 commented on July 1, 2024

@rvowles So I got it to work when I was a super-admin, and as a user whereby I explicitly set for the group they were in that they had access to the environment. But I'm having problems with portfolio admins, as its not working for them with the default settings.

By default the portfolio admins can change values, but if you look at the group permissions. Then the group doesn't have the boxes selected for access. However the portfolio admin can change those values.
Default Settings

BUT if I try and access the feature-history for one of those environments, and use the token from an admin service account that has those rights (or the user's own token), then they get back 404. UNLESS I explicitly change the permissions for the portfolio admin group to have rights on have read rights on the relevant environment. Then after doing that it works.

Shouldn't portfolio admins be able to do the feature-history without having to explicitly grant them access to the environment for each individual application (as they don't need that explicit permission in the UI to change the value in any application that is in the portfolio they are admin of)?

from featurehub.

rvowles avatar rvowles commented on July 1, 2024

Yes, you are absolutely right - its a side effect of portfolio admin's not having their per environment permissions explictly stored, so I better fix that!

from featurehub.

rvowles avatar rvowles commented on July 1, 2024

I actually merged and push this last night my time, so the 1.6.2-RC images should be updated...

from featurehub.

amandam11 avatar amandam11 commented on July 1, 2024

Thanks. I tried the new image and it now works for my portofolio admin.

from featurehub.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.