Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

ci: fix test-migrations target when main branch is not present locally#13306

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
johnstcn merged 1 commit intomainfromcj/fix-release-migrations
May 17, 2024

Conversation

johnstcn
Copy link
Member

@johnstcnjohnstcn commentedMay 17, 2024
edited
Loading

https://github.com/coder/coder/actions/runs/8989166240/job/24691648877 appears to have failed because the local reference tomain was not present. Additionally,git rev-parse produces a slightly cryptic error message when the ref specified does not exit.

To validate this, I deleted themain branch locally and observed the same error before the change. After the change, this works as intended.

@johnstcnjohnstcn self-assigned thisMay 17, 2024
Copy link
Member

@mafredrimafredri left a comment

Choose a reason for hiding this comment

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

Additionally, git rev-parse produces a slightly cryptic error message when the ref specified does not exit.

I didn't notice any significant difference between the commands. 🤔

@@ -797,8 +797,11 @@ test-postgres: test-postgres-docker
test-migrations: test-postgres-docker
echo "--- test migrations"
set -euo pipefail
COMMIT_FROM=$(shell git rev-parse --short HEAD)
COMMIT_TO=$(shell git rev-parse --short main)
COMMIT_FROM=$(shell git log -1 --format='%h' HEAD)
Copy link
Member

Choose a reason for hiding this comment

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

Why short-form, btw? I guess it's more human friendly, but the long-form is more robust.

Copy link
MemberAuthor

Choose a reason for hiding this comment

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

I was initially worried about exceeding the maximum name length of a database name, but it looks like we're under the 63 byte limit even with the long identifier.

COMMIT_FROM=$(shell git rev-parse --short HEAD)
COMMIT_TO=$(shell git rev-parse --short main)
COMMIT_FROM=$(shell git log -1 --format='%h' HEAD)
echo "COMMIT_FROM=$${COMMIT_FROM}"
Copy link
Member

Choose a reason for hiding this comment

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

Pro-tip:declare is pretty nice (declare -p COMMIT_FROM COMMIT_TO. Not necessarily for here, but future reference.

johnstcn reacted with thumbs up emoji
@johnstcn
Copy link
MemberAuthor

I didn't notice any significant difference between the commands. 🤔

I think it's way clearer:

$ git rev-parse --short foobarfatal: Needed a single revision$ git log -1 --format='%H' foobarfatal: ambiguous argument 'foobar': unknown revision or path not in the working tree.Use '--' to separate paths from revisions, like this:'git <command> [<revision>...] -- [<file>...]'

I suppose we could also just read.git/refs/.

@johnstcnjohnstcn merged commitf23d480 intomainMay 17, 2024
@johnstcnjohnstcn deleted the cj/fix-release-migrations branchMay 17, 2024 09:24
@github-actionsgithub-actionsbot locked and limited conversation to collaboratorsMay 17, 2024
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.
Reviewers

@mafredrimafredrimafredri approved these changes

Assignees

@johnstcnjohnstcn

Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@johnstcn@mafredri

[8]ページ先頭

©2009-2025 Movatter.jp