gbif / hosted-portals

Support material for establishing the GBIF Hosted Portals
Apache License 2.0
10 stars 6 forks source link

Use production widgets in HP staging environment #200

Open MortenHofft opened 2 years ago

MortenHofft commented 2 years ago

It is a recurring cause of confusion for site owners that the data widgets aren't the same between their staging site and production site. The reason of course is that the 2 sites are configured to use different react components (staging vs prod).

I suspect it would be better to use the react production library both places. So that the HP site appears the same in staging and production. @MattBlissett you have in the past been opposed to using mixed environments, how do you feel about this?

MattBlissett commented 2 years ago

Isn't this something you control, when making deployments from https://builds.gbif.org/view/Hosted%20Portals/job/gbif-web/ ?

MortenHofft commented 2 years ago

Not as far as I can see no, but I'm not being very clear I must admit. Largely because I'm not sure exactly what I would like.

Current status is: hp-bison is using staging libraries (whichever release/branch is running in that environment) gbif.us is using production libraries (whichever release/branch is running in that environment)

The library on staging and production often differs as staging is essentially a test environment for me as a developer.

But for the hp site owners it is confusing that they see one data widget in staging and another version in production. To avoid this confusion we could use production component libraries and endpoints in the HP staging environments.

this part is controlled by the config parameter site.gbifApacheInclude.componentsScript.

But my first questions isn't really how to do it, but more "is this a good idea at all". I ask because you have in the past been reluctant to "mix" environments. And I understand that it is confusing, but the alternative is confusing as well.

albenson-usgs commented 2 years ago

I am in charge of the site mentioned in this ticket but I do not understand this ticket. I don't think I realized that widgets are different? For me whatever makes it so that changes I make to staging will show up exactly the same in production is what I need. I am not understanding the libraries issue Morten mentions.

MortenHofft commented 2 years ago

Hi @albenson-usgs I just took your site as an example because I could remember the URL. It isn't related to an issue you have mentioned (I think).

The issue is that the text parts and all the things you control are the same in staging as when you do a release to production. So that is predictable (the only difference worth mentioning is unpublished entries)

But that isn't the case for the data widgets (e.g. occurrence search). They might be the same, but might also not be. Because that part can be different per environment. I use the staging environment as a test area for the data widgets before pushing them to production. So in some cases they will differ.

For example I recently added support for some new columns in the table. But I only deployed it to the staging environment. And so one of the site owners (reasonably) assumed that when it appeared in their staging site, then it would also appear in production. But it didn't. Because I hadn't deployed the production libraries yet.

So in short what this issue is about doing just that: make it so that changes made to staging will show up exactly the same in production