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

377 version param #991

Merged
merged 4 commits into from
Jan 23, 2024
Merged

Conversation

SofiaSazonova
Copy link
Contributor

@SofiaSazonova SofiaSazonova commented Jan 19, 2024

Feature or Bugfix

  • Feature

Detail

version.json in repo root contains information about version. This json-string is uploaded to SSM parameter /dataall/{env}/versin. Also this file is copied to frontend folder and version number is displayed near "dataall" header

Relates

#377

Security

Please answer the questions below briefly where applicable, or write N/A. Based on
OWASP 10.

  • Does this PR introduce or modify any input fields or queries - this includes
    fetching data from storage outside the application (e.g. a database, an S3 bucket)? NA
    • Is the input sanitized?
    • What precautions are you taking before deserializing the data you consume?
    • Is injection prevented by parametrizing queries?
    • Have you ensured no eval or similar functions are used?
  • Does this PR introduce any functionality or component that requires authorization? NA
    • How have you ensured it respects the existing AuthN/AuthZ mechanisms?
    • Are you logging failed auth attempts?
  • Are you using or adding any cryptographic features? NA
    • Do you use a standard proven implementations?
    • Are the used keys controlled by the customer? Where are they stored?
  • Are you introducing any new policies/roles/users?NA
    • Have you used the least-privilege principle? How?

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

Sofia Sazonova added 2 commits January 19, 2024 19:49
@SofiaSazonova
Copy link
Contributor Author

SofiaSazonova commented Jan 19, 2024

As long, as @dlpzx required simple way to store version info, I made it as obvious as possible.
Version info is updated only in one file - version.json
We will both have ssm-param for that and static file in the front.

What can be different?
We can introduce another API route (smth like /metadata) to fetch version from backend and display at the frontend.
In this case it will be 100% the same at front and back, but maybe in future we want to have different versions for front and back? Also, I decided not to make another API section just for one version-param.

@SofiaSazonova
Copy link
Contributor Author

Screenshot 2024-01-19 at 20 01 48 Screenshot 2024-01-19 at 20 02 05 Screenshot 2024-01-19 at 20 03 00

@@ -558,6 +559,7 @@ def set_quality_gate_stage(self):
'mkdir -p source_build',
'mv backend ./source_build/',
'mv config.json ./source_build/',
'mv version.json ./source_build/',
Copy link
Contributor

Choose a reason for hiding this comment

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

Do we need this line for UploadCodeToS3? I think we can remove as the source_build.zip is used primarily for DBMigration step only which should not be dependent on version

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I added this for consistency: the whole bunch of code is copied. But I don't insist

Copy link
Contributor

Choose a reason for hiding this comment

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

Let's remove this line mv version.json ./source_build/ - I tested to ensure it is not needed

I think best to keep hardcoding of version.json minimal to only when necessary

Will approve right after this change

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done

@noah-paige
Copy link
Contributor

noah-paige commented Jan 19, 2024

Left a minor comment - otherwise code looks good and a very much needed enhancement 🙌

To finish up testing on the following:

Deployed to AWS (Internet Facing)

  • CICD Successful
  • Version present in login logo + webpage as tooltip

Deployed to AWS (VPC Facing)

  • CICD Successful
  • Version present in login logo + webpage as tooltip

Deployed Local

  • Logo present in webpage

@SofiaSazonova
Copy link
Contributor Author

Now version is tooltip
image

Copy link
Contributor

@noah-paige noah-paige left a comment

Choose a reason for hiding this comment

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

Looks good - approving!

@noah-paige noah-paige merged commit b8b8d23 into data-dot-all:main Jan 23, 2024
9 checks passed
@noah-paige noah-paige linked an issue Jan 23, 2024 that may be closed by this pull request
@SofiaSazonova SofiaSazonova deleted the 377-version-param branch October 3, 2024 13:44
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 parameter to show data.all current version
2 participants