Beapi-io / spring-boot-starter-beapi

Springboot 'convention over config' starter for API Automation
Other
1 stars 1 forks source link

BUG : Demo project needs to have YamlPropertySourceFactory to allow for ENV properties #65

Closed elimelt closed 1 year ago

elimelt commented 1 year ago

Hi,

I'm not sure if this is the correct place to post issues regarding documentation, but it is currently deployed on gh-pages from this repo so I thought I'd post it here.

The instructions for configuring the demo project reference a state of the config repo that contained beapi_api.yaml in the root of the repo, but this no longer seems to be the case. I assumed I needed to copy the config folder for the dev enviornment.

Similarly, I noticed that boot.sql was deleted recently (in this commit, but the current installation/setup instructions don't reflect this change.

orubel commented 1 year ago

yep. You missed a step; see the following (https://github.com/Beapi-io/spring-boot-starter-beapi-config)

Also the boot.sql was deleted because it is MySQL specific. Since the beapi_db.yml can be conbfigured for any DB, providing a Mysql specific db setup doesn't really make sense (and can be confusing)

But am more than happy to provide, if you want it. :)

But yes, I also have to run through and test all documentation again when I get to 7.0

elimelt commented 1 year ago

I think you misunderstood what I was pointing out, but that's understandable since looking back I wasn't very clear. I am aware that the beapi_api.yaml file is contained in the config repo, but as the documentation currently stands, the commands aren't correct.

image

The user would have to copy the beapi_api.yaml file from one of the enviornment specific directories inside the config repo, but the documentation says to copy it directly from the root of the config repo.

So long as the contents of the script don't need to change I can just get them from the previously linked commit, but thank you!

Ah, I see. Updating documentation to remain current with an ever changing piece of software can certainly be tedious. Perhaps it would make sense to version the demo project and config repo along with this repo and its documentation so that potential users have something stable to reference when giving beapi a try.

I'm planning on continuing to go through the current documentation/setup for 0.6.x and will hapily compile a list of issues I run into. If this is something you'd be interested in having documented, would you like me to continue to post them in this thread? I can also create an issue template for documentation fixes if you'd like (or follow one that you create if you'd prefer).

orubel commented 1 year ago

Ah yes. I see.

I BELIEVE the project now reads the ENV variable to get the .boot/{env]/beapi_api.yml file now

you should have to follow that instruction at all.

orubel commented 1 year ago

Yep, just double checked the code and it is using the environment variable to read from:

{user.home}/.beapi/{spring.profiles.active}/beapi_api.yaml So you shouldn't have to move anything; that bit is outdated and I'll remove tomorrow. Good catch :)

orubel commented 1 year ago

fixed and committed in 6.X version of documentation. Checked to make sure it is loading on gh-pages. Closing.

orubel commented 1 year ago

reopening. Apparently this was an actual bug. Looked into this further today and I need to create a 'properties' file for the demo project.

Didn't really put much into the DEMO (because it's a demo) but may as well do it right :)

orubel commented 1 year ago

Ok so this was a two-fold issue. First the documentation was right in that you need to put the config for your env in your project (usually you launch with prod or are working in dev, etc so you only have one config at a time for your service)

second, there WAS an error in that it was copying from an old directory. I am fixing that right now and updating.

orubel commented 1 year ago

Ok. this was an issue with old config files being referenced. Fixed, tested, moved into appropriate repo.

Post 0.7, we need to consider starting separate config branches.