Skip to content

Setup build pipeline to run online tests - #106

Closed
robgruen wants to merge 9 commits into
mainfrom
dev/robgruen/online_tests
Closed

Setup build pipeline to run online tests#106
robgruen wants to merge 9 commits into
mainfrom
dev/robgruen/online_tests

Conversation

@robgruen

@robgruen robgruen commented Nov 21, 2025

Copy link
Copy Markdown
Collaborator
  • Updated github build action to log into azure and dynamically get secrets
  • Set permissions on build action appropriately so it only runs when triggered by authorized user
  • Added getKeys.py to get keys from keyvault (ported from getKeys using Claude Sonnet 4.5).

Comment thread tools/getKeys.py Fixed
Comment thread tools/getKeys.py Fixed
Comment thread tools/getKeys.py Fixed
Comment thread tools/getKeys.py Fixed
Comment thread tools/getKeys.py Dismissed
Comment thread tools/getKeys.py Dismissed
Comment thread tools/getKeys.py Dismissed
Comment thread tools/getKeys.py Fixed
Comment thread tools/getKeys.py Dismissed
Comment thread tools/getKeys.py Fixed
Comment thread tools/getKeys.py Fixed
Comment thread tools/getKeys.py Dismissed
Comment thread tools/getKeys.py Fixed
robgruen and others added 5 commits November 21, 2025 10:20
Comment thread tools/getKeys.py Dismissed
Comment thread tools/getKeys.py Dismissed
@robgruen robgruen closed this Nov 21, 2025

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This looks like an excellent addition!

Not quite a full review, I made it to line 350 or so on my phone. Mostly style nits and mumbling about exception discipline.

GitHub has some quibbles where it thinks you're writing secrets. Not sure how to satisfy it; it's pretty distracting.

Comment thread pyproject.toml
dependencies = [
"azure-identity>=1.22.0",
"azure-mgmt-authorization>=4.0.0",
"azure-mgmt-keyvault>=12.1.1",

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Maybe these two belong in the extras section? They aren't needed for people who just install the package.

Comment thread tools/getKeys.py
@@ -0,0 +1,724 @@
#!/usr/bin/env python3

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Filename should use Python convention, get_keys.py, and ditto for config file.

Comment thread tools/getKeys.py
import uuid
from pathlib import Path
from typing import Dict, List, Tuple, Optional, Set
from datetime import datetime

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Alphabetize imports.

Comment thread tools/getKeys.py
from azure.mgmt.authorization import AuthorizationManagementClient


# ANSI color codes for terminal output

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Use colorama instead -- already used elsewhere.

Comment thread tools/getKeys.py
)
)
except Exception as e:
print(e)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I'd say print(repr(e)) so the exception class names shown too.

Comment thread tools/getKeys.py
Colors.RED,
)
)
raise Exception(f"Unable to find the role '{role_name}'.")

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Use a more specific exception name, e.g. RuntimeError.

Comment thread tools/getKeys.py
account_details = json.loads(result.stdout)
return account_details["id"]
except Exception as e:
print(e)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Again

Comment thread tools/getKeys.py
Colors.RED,
)
)
sys.exit(12)

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

What does 12 mean? Normally we use 1.

Comment thread tools/getKeys.py
await asyncio.sleep(5)

return client.get_secrets(vault_name)
except Exception:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Not printing the exception at all?

Comment thread tools/getKeys.py
print(colored("Elevation successful.", Colors.GREEN))
print(colored("Waiting 5 seconds...", Colors.YELLOW))
await asyncio.sleep(5)
except Exception:

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Again

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.

3 participants