Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add environments to skylight #8104

Merged
merged 1 commit into from
Jul 21, 2020
Merged

Conversation

Tlazypanda
Copy link
Collaborator

Fixes #8103

Added stable and unstable environments to skylight.

  • PR is descriptively titled 📑 and links the original issue above 🔗
  • tests pass -- look for a green checkbox ✔️ a few minutes after opening your PR -- or run tests locally with rake test
  • code is in uniquely-named feature branch and has no merge conflicts 📁
  • screenshots/GIFs are attached 📎 in case of UI updation
  • ask @publiclab/reviewers for help, in a comment below

Thanks!

@codecov
Copy link

codecov bot commented Jul 1, 2020

Codecov Report

Merging #8104 into main will decrease coverage by 0.00%.
The diff coverage is 100.00%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #8104      +/-   ##
==========================================
- Coverage   82.05%   82.05%   -0.01%     
==========================================
  Files         100      100              
  Lines        5773     5772       -1     
==========================================
- Hits         4737     4736       -1     
  Misses       1036     1036              
Impacted Files Coverage Δ
app/controllers/application_controller.rb 92.30% <ø> (ø)
app/controllers/tag_controller.rb 81.34% <100.00%> (-0.06%) ⬇️

@Tlazypanda
Copy link
Collaborator Author

Tlazypanda commented Jul 1, 2020

Hey @jywarren @cesswairimu can you kindly review? Thanks ✌️ I copied the production settings for stable and unstable and changed the hosts in the files and added it to the skylight environment 😅

@Tlazypanda
Copy link
Collaborator Author

Hey @jywarren I think the tests are passing when you check it on the travis pr page but its status on github is not changing 😅

@jywarren
Copy link
Member

jywarren commented Jul 7, 2020

Hmmmmmm something is fishy here.

@jywarren
Copy link
Member

jywarren commented Jul 7, 2020

These at least don't seem to be completed: https://github.com/publiclab/plots2/pull/8104/checks?check_run_id=825545745

@jywarren
Copy link
Member

jywarren commented Jul 7, 2020

The ones that aren't passing here are from 6 days ago. Would you mind trying to rebase this to see if we get a clean run? I wonder if it's related to the switch to Travis-ci.com from Travis-ci.org?

https://github.com/publiclab/plots2/pull/8104/checks?check_run_id=825545745

Thank you and sorry for the trouble!

@Tlazypanda
Copy link
Collaborator Author

Tlazypanda commented Jul 7, 2020

Hey @jywarren actually I opened the jobs on the link that you sent which show as yellow now but on opening them it is green 😅 is this from before test? Ohh yes just checked those are the ones triggered before my bad sorry 😅 I will take a rebase

@Tlazypanda
Copy link
Collaborator Author

Hey @jywarren just adding to the slow travis test point that you mentioned, the tests in this run are still queued and haven't even started yet https://travis-ci.com/github/publiclab/plots2/jobs/358427078 😅

@jywarren
Copy link
Member

jywarren commented Jul 7, 2020

Hmm. I wonder if we're hitting a rate limit. I have restarted a TON of travis tests today.

@jywarren
Copy link
Member

jywarren commented Jul 7, 2020

This looks great! Thank you!!! cc @icarito bc we would have split config files. Just checking that's OK?

@jywarren jywarren requested a review from icarito July 7, 2020 17:24
@icarito
Copy link
Member

icarito commented Jul 9, 2020

Hi!
Sorry for the delay in reviewing.
I see a lot of duplication here, could this rather be accomplished by environment variables rather than having one config per environment?
The idea currently is that staging runs in production mode so that it is as close as possible to actual production.
We currently have one config for each environment in containers/ but I would also like to refactor those into one with env variables.

Copy link
Member

@icarito icarito left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm unfamiliar with rails environments and skylight environments, currently we run staging in production mode. Would these changes affect this?
If not I'm fine with adding extra config for Skylight, if env variables would help to avoid duplication that'd be awesome.

@jywarren
Copy link
Member

Hi @Tlazypanda do you have any insight on this q from @icarito? Thank you!

@@ -0,0 +1,89 @@
Plots2::Application.configure do
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do these extend the existing configs, or replace them? Thanks!

@Tlazypanda
Copy link
Collaborator Author

Tlazypanda commented Jul 21, 2020

Hey @jywarren since this is a new area for me I am not completely sure how to implement on ENV variables 😅 I also did some digging but couldn't find much around it catered to rails environments 😅 As for the extending/replacing thing I think it's replacing on it since that is how it is in the other development/test environments as well and I have copied the entire production config here and just changed the hosts 😅 any guidance/help on this will be appreciated I did see that we can import files to reduce redundancy but that was not in the case of environments so I am not sure if that will work here

@jywarren
Copy link
Member

Hi, well, if you are pretty sure this will only affect the skylight run and environment, I think this is OK! Let's merge it - if we find something goes wrong, we can revert back, it's not such a big thing. Thanks and I appreciate your patience as we're pretty careful with this!

@jywarren jywarren merged commit f5a133a into publiclab:main Jul 21, 2020
@jywarren
Copy link
Member

🎉

@jywarren
Copy link
Member

Just noting docs for this here:

https://www.skylight.io/support/environments

If it doesn't work, we could revert and try the env variable approach listed there!

https://www.skylight.io/support/environments#for-rails-using-environment-variables

@Tlazypanda i invited you to our Skylight account! I don't see the new env yet, but, hopefully soon!

@Tlazypanda
Copy link
Collaborator Author

Tlazypanda commented Jul 22, 2020

Hey @jywarren I am not sure why the environment is not showing 😅 can we try the second approach? I am not sure where we are supposed to add the environment variables for that (is it the docker compose files for stable and unstable?)

But I am not sure why this is not working though 😥 @icarito can you please weigh in ..I am kinda new to this environment and env thing and feel might be making some silly mistakes

dms-yondy pushed a commit to dms-yondy/plots2 that referenced this pull request Aug 7, 2020
@icarito
Copy link
Member

icarito commented Aug 14, 2020

I think https://www.skylight.io/support/environments#3-optional-specify-an-environment-name seems to indicate that the SKYLIGHT_ENV needs to be set if we don't change RAILS_ENV (and we don't, staging mimics production so it has same RAILS_ENV).
So I've set SKYLIGHT_ENV for unstable branch in staging, and also made relevant changes to docker-compose-unstable.yml file. If it works we can extend the solution and set more environment variables.

@jywarren
Copy link
Member

jywarren commented Sep 1, 2020

@Tlazypanda did that end up working out?

@Tlazypanda
Copy link
Collaborator Author

Hey @jywarren I think what @icarito has done works 🎉 since I can see unstable as an option in the skylight dropdown 💯
Thanks @icarito!!

nadimakhtar97 pushed a commit to nadimakhtar97/plots2 that referenced this pull request Sep 21, 2020
shubhangikori pushed a commit to shubhangikori/plots2 that referenced this pull request Oct 12, 2020
alvesitalo pushed a commit to alvesitalo/plots2 that referenced this pull request Oct 14, 2020
piyushswain pushed a commit to piyushswain/plots2 that referenced this pull request Oct 22, 2020
manchere pushed a commit to manchere/plots2 that referenced this pull request Feb 13, 2021
lagunasmel pushed a commit to lagunasmel/plots2 that referenced this pull request Mar 2, 2021
reginaalyssa pushed a commit to reginaalyssa/plots2 that referenced this pull request Oct 16, 2021
ampwang pushed a commit to ampwang/plots2 that referenced this pull request Oct 26, 2021
billymoroney1 pushed a commit to billymoroney1/plots2 that referenced this pull request Dec 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add stable and unstable environments to skylight for monitoring
3 participants