You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@trafficcontrol.apache.org by GitBox <gi...@apache.org> on 2021/08/17 17:54:08 UTC

[GitHub] [trafficcontrol] ocket8888 commented on a change in pull request #6111: Update Go version to 1.17

ocket8888 commented on a change in pull request #6111:
URL: https://github.com/apache/trafficcontrol/pull/6111#discussion_r690593746



##########
File path: .github/actions/build-rpms/build-rpms.sh
##########
@@ -0,0 +1,43 @@
+#!/usr/bin/env bash
+# Licensed to the Apache Software Foundation (ASF) under one
+# or more contributor license agreements.  See the NOTICE file
+# distributed with this work for additional information
+# regarding copyright ownership.  The ASF licenses this file
+# to you under the Apache License, Version 2.0 (the
+# "License"); you may not use this file except in compliance
+# with the License.  You may obtain a copy of the License at
+#
+#   http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing,
+# software distributed under the License is distributed on an
+# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+# KIND, either express or implied.  See the License for the
+# specific language governing permissions and limitations
+# under the License.
+
+set -o errexit -o nounset -o pipefail -o xtrace
+trap 'echo "Error on line ${LINENO} of ${0}"; exit 1' ERR
+
+export DOCKER_BUILDKIT=1 COMPOSE_DOCKER_CLI_BUILD=1
+
+pkg_command=(./pkg -v)
+# If the Action is being run on a Pull Request
+if [[ "$GITHUB_REF" == refs/pull/*/merge ]]; then
+	sudo apt-get install jq
+	pr_number="$(<<<"$GITHUB_REF" grep -o '[0-9]\+')"
+	files_changed="$(curl "${GITHUB_API_URL}/repos/${GITHUB_REPOSITORY}/pulls/${pr_number}/files" | jq -r .[].filename)"
+else
+	files_changed="$(git diff-tree --no-commit-id --name-only -r "$GITHUB_SHA")"
+fi
+if <<<"$files_changed" grep '^GO_VERSION$'; then
+	pkg_command+=(-b)
+fi
+
+if [[ -z "${ATC_COMPONENT:-}" ]]; then
+	echo 'Missing environment variable ATC_COMPONENT' >/dev/stderr

Review comment:
       does piping to fd 2 not work? I don't think it's actually a problem, I just don't normally see it done this way, so I was curious.

##########
File path: .github/actions/pr-to-update-go/pr_to_update_go/go_pr_maker.py
##########
@@ -316,18 +327,18 @@ def set_go_version(self, go_version: str, commit_message: str,
 		print(f'Updated {go_version_file} on {self.repo.name}')
 		return commit
 
-	def update_golang_org_x(self, previous_commit: Commit) -> Union[GitCommit, None]:
+	def update_golang_org_x(self, previous_commit: Commit) -> Optional[GitCommit]:
 		"""
 		:param previous_commit:
 		:type previous_commit:
 		:return:
-		:rtype: Union[GitCommit, None]
+		:rtype: Optional[GitCommit]

Review comment:
       fwiw, I wouldn't bother adding return and parameter types like this when that information is already available in the annotations.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@trafficcontrol.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org