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

Create a mechanism to fail the CD when required environment variables are missing | issue#257 #274

Open
wants to merge 4 commits into
base: develop
Choose a base branch
from

Conversation

Saitharun279
Copy link

@Saitharun279 Saitharun279 commented Oct 13, 2024

Date: 13-10-2024

Developer Name: Saitharun Burra


Issue Ticket Number

Description

Added a job called Environment-Variables-Check to the Register and deploy Slash Commands Github Action. This jobs runs first in sequence to check whether the required environment variables have been configured or not. Fails the workflow incase any of the required environment variables are not configured.

Documentation Updated?

  • Yes
  • No

Under Feature Flag

  • Yes
  • No

Database Changes

  • Yes
  • No

Breaking Changes

  • Yes
  • No

Development Tested?

  • Yes
  • No

Screenshots

Attached 2 videos 1st one contains happy path test for environment variable check when all the required env var are set. This was tested in staging environment with all the required environment variables in the file configured. And the other one displays error logs when the required env var are not set. This was tested in production environment with none of the environment variables set.

Note: All the tests have been conducted in the forked repo.

Screen.Recording.2024-10-13.at.11.40.32.PM.mov
Screen.Recording.2024-10-13.at.11.41.15.PM.mov

Test Coverage

Screenshot 1

Additional Notes

design doc
https://docs.google.com/document/d/1qwCHNbsCONjSTtOkF6wqNdJ4kwkgI11gwbQ_xdPK_m0/edit?pli=1&tab=t.0

@Saitharun279 Saitharun279 changed the title Feature/issue#257 Create a mechanism to fail the CD when required environment variables are missing | issue#257 Oct 13, 2024
Copy link
Member

Choose a reason for hiding this comment

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

do we really need this file, .env file is not enough

Copy link
Author

@Saitharun279 Saitharun279 Oct 13, 2024

Choose a reason for hiding this comment

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

Initially i tried by hardcoding the environment variables in the bash script along with "if" conditional blocks for each env var. To use while loop I stored them in a file, bash script iterates through each env var and checks if they are set.

.env file is used for local setup as per guidelines in contributing.MD file link.

So I used a different file.

We can add a .env file as well, but that will be confusing during local setup.

Copy link
Author

Choose a reason for hiding this comment

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

Removed that file , instead added one env var to store all the actual env var names

Copy link
Member

@iamitprakash iamitprakash left a comment

Choose a reason for hiding this comment

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

comment added

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.

Create a mechanism to fail the CD when required environment variables are missing
2 participants