Repository navigation
Document the most concise set of instructions for self hosting #4
Description
Activity
@dabeeeenster @riceyrice I can help with documenting this as I am currently trying to setup the forge app for our jira organization.
I made following changes in the codebase before deploying and installing the app:-- I changed this to our self-hosted flagsmith backend api url
- I changed this to our self-hosted flagsmith portal url
- I changed this as well to our self-hosted flagsmith url
With these changes I tried deploying the forge app into our jira site. The installation was successful. I then configured the jira app providing our api token, which was also successful.
Then I tried to map one of our jira projects to a flagsmith project via jira project settings. While trying to do so I received an error sayingThere was an error in the jira api response
Further I tried debugging the app via forge debug, and saw this error:-DEBUG 13:01:25.873 8a315e5e-0a78-426f-ab8f-bd8955df554f { "errors": {}, "errorMessages": [ "The property flagsmith.project does not exist." ], "httpStatusCode": { "empty": false, "present": true } }If you have any pointers for me around how to fix this, I would highly appreciate it.
Once fixed, I can document all the steps I had to perform to get it working so that others can benefit.Reacted by Stephen RiceHi @nishant-shah-social sorry for the delayed response. It looks like you've changed all the necessary places for connecting self-hosted Flagsmith to what I assume is self-hosted Jira? If deploying to SaaS Jira I'd expect you to also need to change the app ID in
manifest.yaml- or did you also do that?The error you're seeing seems like a bug in the Jira integration, though I'm surprised nobody else has seen this. It should not error if the property hasn't been set yet. I can't find anywhere in the code that would output the exact error message you provide. Perhaps something has changed in SaaS Jira, or are you deploying to some other Jira?
I think the relevant code is here if you want to try to add some more debugging:
flagsmith-jira-integration/flagsmith-jira-app/src/jira.ts
Lines 92 to 94 in 3a5f8e8
export const readProjectId = async (jiraContext: JiraContext): Promise<string | undefined> => await getEntityProperty("project", jiraContext, PROJECT_ID); Ultimately this passes through to a
checkResponsefunction call which should handle a 404 response. If Jira is returning something else, it will outputUnexpected Jira API response:followed by the HTTP status of the response. I would expect this to be a 404 if the property doesn't exist, but maybe something has changed:
throw new ApiError("Unexpected Jira API response:", response.status); Hope that helps!
Thanks for responding @riceyrice !
We are using Cloud Jira. Yes, I did change theappIdas well in themanifest.yamlto a sample app I created. Sorry, I missed mentioning about it.
I will try to debug this further in the code.Regards,
Nishant ShahReacted by Stephen Rice@riceyrice I found the problem and we managed to fix it and install+ configure the app successfully.
We required these headers to be present for the PUT call to be successful hereheaders: { 'Accept': 'application/json', 'Content-Type': 'application/json' }I tried raising a PR but somehow I wasn't able to create a branch and push my commit.
Thanks,
Nishant ShahThanks for letting us know, that's very helpful!
In order to create a PR you'll need to fork the repo and submit it that way, we'd love to receive it if you're happy to do that.
Thanks,
MattSure @matthewelwell
I have created a PR
Thanks!
People self hosting Flagsmith will need to push their own Forge application with the approriate whitelisted domains.
We should add concise documentation on how to achieve this, starting from:
i.e. with no Jira marketplace/developer accounts.