Skip to content

Commit

Permalink
Revert "OPS-16623 add pipeline build number option (#222)" (#226)
Browse files Browse the repository at this point in the history
This reverts commit 8f1d113.
  • Loading branch information
dsielert authored Jun 8, 2021
1 parent 0cd5a24 commit fa9fc03
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 26 deletions.
2 changes: 0 additions & 2 deletions efopen/ef_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,6 @@ class EFConfig(object):
S3_VERSION_CONTENT_ENCODING = "utf-8"
# Metdata key on a version object to indicate who modified it
S3_VERSION_BUILDNUMBER_KEY = "ef-buildnumber"
# Metdata key on a version object to indicate what the pipeline build number was for subservice relation
S3_VERSION_PIPELINEBUILDNUMBER_KEY = "ef-pipeline-buildnumber"
# Metdata key on a version object to indicate who modified it
S3_VERSION_COMMITHASH_KEY = "ef-commithash"
# Metdata key on a version object to indicate who modified it
Expand Down
25 changes: 1 addition & 24 deletions efopen/ef_version.py
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,6 @@ def __init__(self):
super(EFVersionContext, self).__init__()
# core stuff
self._build_number = None
self._pipeline_build_number = None
self._commit_hash = None
self._force_env_full = None
self._get = None
Expand All @@ -74,17 +73,6 @@ def build_number(self, value):
"""Setter provided because this is writeable from other than init() because --rollback alters it"""
self._build_number = value

@property
def pipeline_build_number(self):
"""Externally defined PIPELINE build number associated with version entity"""
return self._pipeline_build_number

@pipeline_build_number.setter
def pipeline_build_number(self, value):
"""Setter provided because this is writeable from other than init() because --rollback alters it"""
self._pipeline_build_number = value


@property
def commit_hash(self):
"""Commit hash associated with version entity"""
Expand Down Expand Up @@ -195,14 +183,13 @@ def __init__(self, object_version):

metadata = object_version["Metadata"]
self._build_number = metadata.get(EFConfig.S3_VERSION_BUILDNUMBER_KEY,"")
self._pipeline_build_number = metadata.get(EFConfig.S3_VERSION_PIPELINEBUILDNUMBER_KEY,"null")
self._commit_hash = metadata.get(EFConfig.S3_VERSION_COMMITHASH_KEY,"")
self._location = metadata.get(EFConfig.S3_VERSION_LOCATION_KEY,"")
self._modified_by = metadata.get(EFConfig.S3_VERSION_MODIFIEDBY_KEY,"")
self._status = metadata.get(EFConfig.S3_VERSION_STATUS_KEY,"")

def __str__(self):
return "{} {} {} {} {} {} {} {}".format(self._value, self._build_number, self._pipeline_build_number, self._commit_hash, self._last_modified,
return "{} {} {} {} {} {} {} {}".format(self._value, self._build_number, self._commit_hash, self._last_modified,
self._modified_by, self._version_id, self._location, self._status)

def __repr__(self):
Expand All @@ -215,7 +202,6 @@ def to_json(self):
"""
return {
"build_number": self._build_number,
"pipeline_build_number": self._pipeline_build_number,
"commit_hash": self._commit_hash,
"last_modified": self._last_modified,
"location": self._location,
Expand All @@ -229,10 +215,6 @@ def to_json(self):
def build_number(self):
return self._build_number

@property
def pipeline_build_number(self):
return self._pipeline_build_number

@property
def commit_hash(self):
return self._commit_hash
Expand Down Expand Up @@ -295,9 +277,6 @@ def handle_args_and_set_context(args):
parser.add_argument("--build",
help="On --set, also set the externally defined build number associated with the version entity",
default="")
parser.add_argument("--pipeline_build",
help="On --set, also set the externally defined PIPELINE build number associated with the version entity",
default="")
parser.add_argument("--commit_hash", help="On --set, also set the commit hash associated with the version entity",
default="")
parser.add_argument("--commit", help="Actually --set or --rollback (dry run if omitted)",
Expand All @@ -319,7 +298,6 @@ def handle_args_and_set_context(args):
context = EFVersionContext()
# marshall the inherited context values
context._build_number = parsed_args["build"]
context._pipeline_build_number = parsed_args["pipeline_build"]
context._commit_hash = parsed_args["commit_hash"]
context.commit = parsed_args["commit"]
context.devel = parsed_args["devel"]
Expand Down Expand Up @@ -602,7 +580,6 @@ def cmd_set(context):
Key=s3_key,
Metadata={
EFConfig.S3_VERSION_BUILDNUMBER_KEY: context.build_number,
EFConfig.S3_VERSION_PIPELINEBUILDNUMBER_KEY: context.pipeline_build_number,
EFConfig.S3_VERSION_COMMITHASH_KEY: context.commit_hash,
EFConfig.S3_VERSION_LOCATION_KEY: context.location,
EFConfig.S3_VERSION_MODIFIEDBY_KEY: context.aws_client("sts").get_caller_identity()["Arn"],
Expand Down

0 comments on commit fa9fc03

Please sign in to comment.