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

Using generateString in all scripts that deploy a machine #3822

Open
wants to merge 9 commits into
base: development
Choose a base branch
from

Conversation

maayarosama
Copy link
Contributor

@maayarosama maayarosama commented Jan 16, 2025

Description

Using generateString in all scripts that deploy a machine

Related Issues

Tested Scenarios

  • run scripts

To consider

Preliminary Checks:

  • Preliminary Checks
    • Does it completely address the issue linked?
    • What about edge cases?
    • Does it meet the specified acceptance criteria?
    • Are there any unintended side effects?
    • Does the PR adhere to the team's coding conventions, style guides, and best practices?
    • Does it integrate well with existing features?
    • Does it impact the overall performance of the application?
    • Are there any bottlenecks or slowdowns?
    • Has it been optimized for efficiency?
    • Has it been adequately tested with unit, integration, and end-to-end tests?
    • Are there any known defects or issues?
    • Is the code well-documented?
    • Are changes to documentation reflected in the code?

UI Checks:

  • UI Checks
    • If a UI design is provided/ does it follow it?
    • Does every button work?
    • Is the data displayed logical? Is it what you expected?
    • Does every validation work?
    • Does this interface feel intuitive?
    • What about slow network? Offline?
    • What if the gridproxy/graphql/chain is failing?
    • What would a first time user have a hard time navigating here?

Code Quality Checks:

  • Code Quality Checks
    • Code formatted/linted? Are there unused imports? .. etc
    • Is there redundant/repeated code?
    • Are there conditionals that are always true or always false?
    • Can we write this more concisely?
    • Can we reuse this code? If yes, where?
    • Will the changes be easy to maintain and update in the future?
    • Can this code become too complex to understand for other devs?
    • Can this code cause future integration problems?

Testing Checklist

  • Does it Meet the specified acceptance criteria.
  • Test if changes can affect any other functionality.
  • Tested with unit, integration, and end-to-end tests.
  • Tested the un-happy path and rollback scenarios.
  • Documentation updated to meet the latest changes.
  • Check automated tests working successfully with the changes.
  • Can be covered by automated tests.

General Checklist

  • Tests included
  • Build pass
  • Documentation
  • Code format and docstring
  • Screenshots/Video attached (needed for UI changes)

@amiraabouhadid
Copy link
Contributor

amiraabouhadid commented Jan 19, 2025

issue isn't just for scripts that deploy a VM, please update PR title and scripts accordingly . I'd do a global search for 'name' in scripts and add generateString() for matches

@maayarosama maayarosama changed the title Using generateString in all scripts that deploy a vm Using generateString in all scripts that deploy a machine Jan 19, 2025
@maayarosama
Copy link
Contributor Author

issue isn't just for scripts that deploy a VM, please update PR title and scripts accordingly . I'd do a global search for 'name' in scripts and add generateString() for matches

I'm not sure what scripts exactly you want me to change, so can you please provide me with the scripts?

@amiraabouhadid
Copy link
Contributor

Copy link
Contributor

@0oM4R 0oM4R left a comment

Choose a reason for hiding this comment

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

image

I could run the script twice, i have 2 deployments

but in the deployment list we have to deployements with same name
image

i suggest to add the random string as postfix to the machine.name

@maayarosama maayarosama requested a review from 0oM4R January 23, 2025 09:42
@0oM4R
Copy link
Contributor

0oM4R commented Jan 30, 2025

deployed two VMS and got only one network wedtest I'm not sure if we have to use random string in the network name as well
image

@0oM4R
Copy link
Contributor

0oM4R commented Jan 30, 2025

also what about storing the random string and reuse it in the file, instead of generating 2 or 3 random strings

@maayarosama
Copy link
Contributor Author

deployed two VMS and got only one network wedtest I'm not sure if we have to use random string in the network name as well image

This's not an issue as there's already a network created on node 128, so the network just needs to update the newly reserved ports

@maayarosama maayarosama marked this pull request as ready for review February 7, 2025 20:47
@AhmedHanafy725
Copy link
Contributor

deployed two VMS and got only one network wedtest I'm not sure if we have to use random string in the network name as well image

the network name should be random as well. If we use the same name between 2 scripts that require 2 different specs, the deployment will fail (e.g.: require mycelium in the second script while the first one doesn't have it)

@ramezsaeed
Copy link
Contributor

deployed two VMS and got only one network wedtest I'm not sure if we have to use random string in the network name as well image

the network name should be random as well. If we use the same name between 2 scripts that require 2 different specs, the deployment will fail (e.g.: require mycelium in the second script while the first one doesn't have it)

+1 for Hanafy suggestion and lets add this in test scenarios.

Copy link
Contributor

@amiraabouhadid amiraabouhadid left a comment

Choose a reason for hiding this comment

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

please also add it in multiple_vms script
image

Copy link
Contributor

@0oM4R 0oM4R left a comment

Choose a reason for hiding this comment

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

network name is randomized

the name we want to be randomized is the network.name

for example

const vms: MachinesModel = {
name,
network: {
name: "wedtest",
ip_range: "10.249.0.0/16",
},
machines: [

we suggest to make it random; and keep it with the generatedstring before
name = 'net${name}

@maayarosama maayarosama requested a review from 0oM4R February 10, 2025 14:50
Copy link
Contributor

@0oM4R 0oM4R left a comment

Choose a reason for hiding this comment

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

Thank you Mayar!

@@ -44,7 +44,7 @@ async function cancel(client, vms, gw) {
}

async function main() {
const name = "giteainstance";
const name = "gt" + generateString(8);
const networkName = "giteanetwork";
Copy link
Contributor

Choose a reason for hiding this comment

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

For the sake of consistency, use a random network name here too

@@ -23,7 +24,7 @@ const hexMessage = message
.split("")
.map((letter, i) => message.charCodeAt(i).toString(16))
.join("");
const name = "testAcc";
const name = generateString(10);

async function main() {
const account: AlgorandAccountCreateModel = {
Copy link
Contributor

Choose a reason for hiding this comment

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

please use random name for account creation and deletion

@@ -26,7 +26,8 @@ async function deleteWorker(client, worker) {
}

async function main() {
const name = "testk8s";
const name = "k8s" + generateString(8);
Copy link
Contributor

Choose a reason for hiding this comment

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

please add a comment for the user to change the name to an existing cluster name so he can add the worker to it

@@ -24,7 +24,7 @@ async function cancel(client, zdb) {
}

async function main() {
const name = "tttzdbs";
const name = "zdb" + generateString(8);
Copy link
Contributor

Choose a reason for hiding this comment

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

please use this name as the zdb instance name to have a unique contract hash

@maayarosama maayarosama marked this pull request as draft February 16, 2025 09:21
@maayarosama maayarosama marked this pull request as ready for review February 16, 2025 11:34
const name = "wed2710t1";
const name = "vm" + generateString(8);
const networName = `net${name}`;

const grid3 = await getClient(`vm/${name}`);

const qsfs_name = "wed2710q1";
Copy link
Contributor

Choose a reason for hiding this comment

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

why don't we use generate string for qsfs_name?

Copy link
Contributor

@amiraabouhadid amiraabouhadid Feb 17, 2025

Choose a reason for hiding this comment

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

can we use generateString for name in line 7?

Copy link
Contributor

Choose a reason for hiding this comment

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

can we use generateString for qsfs_name?

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.

5 participants