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

DOP-4274: Label inactive branches in Slack Deploy Modal #965

Merged
merged 22 commits into from
Jan 26, 2024

Conversation

anabellabuckvar
Copy link
Contributor

@anabellabuckvar anabellabuckvar commented Jan 18, 2024

Context

It is very easy to accidentally deploy inactive versions in the Slack dropdown at /deploy - they need to be deployable to enable corrective edits or deploy-related platform functions, but there isn't visibility on which are inactive within the modal.

DOP-4274

Staging

The changes were tested and staged in preprd. Inactive branch entries are labeled within the /deploy and /test_deploy UI.

Screenshot 2024-01-23 at 11 35 25 AM

Copy link

Your feature branch infrastructure has been deployed!

Your webhook URL is: https://5aj73wwjea.execute-api.us-east-2.amazonaws.com/prod/webhook/githubEndpoint/trigger/build

For more information on how to use this endpoint, follow these instructions.

@anabellabuckvar anabellabuckvar changed the title Dop 4274 Dop 4274: Label inactive branches in Slack Deploy Modal Jan 19, 2024
@@ -24,14 +24,19 @@ export async function buildEntitledBranchList(entitlement: any, repoBranchesRepo
const [repoOwner, repoName, directoryPath] = repo.split('/');
const branches = await repoBranchesRepository.getRepoBranches(repoName, directoryPath);
for (const branch of branches) {
let buildWithSnooty = true;
if ('buildsWithSnooty' in branch) {
Copy link
Contributor

Choose a reason for hiding this comment

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

I know this is a holdover from the past, but I think we can get rid of this conditional. It doesn't gate anything and we're just checking true/false which undefined will work for as well.

branch['gitBranchName']
}`;
if (!active) {
entitledBranches.push(`!Inactive ` + `${repoPath}`);
Copy link
Contributor

Choose a reason for hiding this comment

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

total nit: Because of the font-style of Slack, I think it might be more readable with a lower-case i

Copy link
Contributor

Choose a reason for hiding this comment

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

And up for debate - I'm wondering how to make it the most pleasing when we have no access to style. I wonder if it would look better in parentheses?
(!inactive) 10gen/docs/master
wdyt?

Copy link
Contributor

Choose a reason for hiding this comment

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

Oh another nit: since you're already using template strings, you can get rid of the concatenation!

(!inactive) ${repoPath}

Copy link
Contributor Author

@anabellabuckvar anabellabuckvar Jan 19, 2024

Choose a reason for hiding this comment

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

I definitely think in parentheses would look better! I was following the ticket exactly but thats a great idea, thank you; I'll confirm in the channel

** UPDATE: Cassidy confirmed parentheses

Comment on lines 179 to 191
const fullBranchPath = fullPath;
const displayBranchPath = fullPath;
let valueBranchPath = fullPath;
const inactiveStr = /!inactive/gi;
const isInactive = fullPath.search(inactiveStr);
if (isInactive != -1) {
valueBranchPath = fullPath.slice(10);
}
const opt = {
text: {
type: 'plain_text',
text: fullBranchPath,
text: displayBranchPath,
},
value: fullBranchPath,
value: valueBranchPath,
Copy link
Contributor

Choose a reason for hiding this comment

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

Maybe we can use a quick startsWith method to make this more legible. Link to MDN

@anabellabuckvar anabellabuckvar changed the title Dop 4274: Label inactive branches in Slack Deploy Modal DOP-4274: Label inactive branches in Slack Deploy Modal Jan 22, 2024
@@ -3,6 +3,7 @@ on:
branches:
- "master"
- "integration"
- "DOP-4274"
Copy link
Contributor

Choose a reason for hiding this comment

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

Just a reminder to remove this before merging

@anabellabuckvar anabellabuckvar merged commit e2c2607 into master Jan 26, 2024
10 checks passed
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.

2 participants