Add CI_JOB_KEY to override log paths (#27210)
* Add CI_JOB_KEY * Update to none * ternary operator override --------- Co-authored-by: Octavia Squidington III <octavia-squidington-iii@sers.noreply.github.com> Co-authored-by: alafanechere <augustin.lafanechere@gmail.com> Co-authored-by: Augustin <augustin@airbyte.io>
This commit is contained in:
@@ -213,7 +213,6 @@ class PytestStep(Step, ABC):
|
||||
"""
|
||||
test_config = "pytest.ini" if await check_path_in_workdir(connector_under_test, "pytest.ini") else "/" + PYPROJECT_TOML_FILE_PATH
|
||||
if await check_path_in_workdir(connector_under_test, test_directory):
|
||||
|
||||
tester = connector_under_test.with_exec(
|
||||
[
|
||||
"python",
|
||||
|
||||
@@ -68,6 +68,7 @@ def get_modified_files(
|
||||
@click.option("--pull-request-number", envvar="PULL_REQUEST_NUMBER", type=int)
|
||||
@click.option("--ci-github-access-token", envvar="CI_GITHUB_ACCESS_TOKEN", type=str)
|
||||
@click.option("--ci-report-bucket-name", envvar="CI_REPORT_BUCKET_NAME", type=str)
|
||||
@click.option("--ci-job-key", envvar="CI_JOB_KEY", type=str)
|
||||
@click.pass_context
|
||||
def airbyte_ci(
|
||||
ctx: click.Context,
|
||||
@@ -81,6 +82,7 @@ def airbyte_ci(
|
||||
pull_request_number: int,
|
||||
ci_github_access_token: str,
|
||||
ci_report_bucket_name: str,
|
||||
ci_job_key: str,
|
||||
): # noqa D103
|
||||
ctx.ensure_object(dict)
|
||||
ctx.obj["is_local"] = is_local
|
||||
@@ -93,6 +95,7 @@ def airbyte_ci(
|
||||
)
|
||||
ctx.obj["ci_context"] = ci_context
|
||||
ctx.obj["ci_report_bucket_name"] = ci_report_bucket_name
|
||||
ctx.obj["ci_job_key"] = ci_job_key
|
||||
ctx.obj["pipeline_start_timestamp"] = pipeline_start_timestamp
|
||||
|
||||
if pull_request_number and ci_github_access_token:
|
||||
|
||||
@@ -66,6 +66,8 @@ def render_report_output_prefix(ctx: click.Context) -> str:
|
||||
git_revision = ctx.obj["git_revision"]
|
||||
pipeline_start_timestamp = ctx.obj["pipeline_start_timestamp"]
|
||||
ci_context = ctx.obj["ci_context"]
|
||||
ci_job_key = ctx.obj["ci_job_key"] if ctx.obj.get("ci_job_key") else ci_context
|
||||
|
||||
sanitized_branch = git_branch.replace("/", "_")
|
||||
|
||||
# get the command name for the current context, if a group then prepend the parent command name
|
||||
@@ -75,7 +77,7 @@ def render_report_output_prefix(ctx: click.Context) -> str:
|
||||
|
||||
path_values = [
|
||||
cmd,
|
||||
ci_context,
|
||||
ci_job_key,
|
||||
sanitized_branch,
|
||||
pipeline_start_timestamp,
|
||||
git_revision,
|
||||
|
||||
Reference in New Issue
Block a user