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

[gql] allow defining current sha #4616

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions reconcile/utils/gql.py
Original file line number Diff line number Diff line change
Expand Up @@ -450,13 +450,17 @@ def get_api_for_server(

@retry(exceptions=requests.exceptions.HTTPError, max_attempts=5)
def get_diff(
old_sha: str, file_type: str | None = None, file_path: str | None = None
old_sha: str,
current_sha: str | None = None,
file_type: str | None = None,
file_path: str | None = None,
) -> dict[str, Any]:
config = get_config()

server_url = urlparse(config["graphql"]["server"])
token = config["graphql"].get("token")
current_sha = get_sha(server_url, token)
if not current_sha:
current_sha = get_sha(server_url, token)
logging.debug(f"get bundle diffs between {old_sha} and {current_sha}...")
if file_type and file_path:
if not file_path.startswith("/"):
Expand Down