Skip to content

Check for changelog and/or pull contents from changelog using remote origin #55

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

Merged
merged 4 commits into from
Aug 14, 2020

Conversation

weierophinney
Copy link
Member

Q A
Bugfix #51
BC Break No

As it turns out, while you can use git show {ref}:{filename} to both test for the existing of a file at a given reference, as well as display its contents, it only works if the reference is present.

When the github action starts, it exports the default branch to the working directory. Our code then fetches from the remote, which then sets the current branch to the default branch, which may or may not be the branch we are releasing from. It's not until we do a checkout operation that the release branch can be guaranteed as a reference in the checkout.

The reference does exist in the origin remote, and since we have all history, that means the content is present in our checkout; it's just that the reference doesn't exist IN the checkout.

As such, for idempotent operations where we are checking for the existence of a file, or pulling its contents, we need to qualify the reference with the remote name (e.g., {remote}/1.0.x). Since we can guarantee that the origin remote is present, we can use that remote name.

Fixes #51

Signed-off-by: Matthew Weier O'Phinney <[email protected]>
…a given branch

Signed-off-by: Matthew Weier O'Phinney <[email protected]>
…mote origin

As it turns out, while you can use `git show {ref}:{filename}` to both
test for the existing of a file at a given reference, as well as display
its contents, it only works if the reference is present.

When the github action starts, it _exports_ the default branch to the
working directory. Our code then _fetches_ from the remote, which then
sets the current branch to the _default_ branch, which may or may not be
the branch we are releasing from. It's not until we do a checkout
operation that the release branch can be guaranteed as a reference in
the checkout.

The reference _does_ exist in the `origin` remote, and since we have all
history, that means the content is present in our checkout; it's just
that the reference doesn't exist **IN** the checkout.

As such, for idempotent operations where we are checking for the
existence of a file, or pulling its contents, we need to qualify the
reference with the remote name (e.g., `{remote}/1.0.x`). Since we can
guarantee that the `origin` remote is present, we can use that remote
name.

Fiexes laminas#51

Signed-off-by: Matthew Weier O'Phinney <[email protected]>
@weierophinney weierophinney added this to the 1.2.4 milestone Aug 14, 2020
@weierophinney weierophinney added the Bug Something isn't working label Aug 14, 2020
Updates CHANGELOG.md file with info on fix introduced in laminas#55.

Signed-off-by: Matthew Weier O'Phinney <[email protected]>
@Ocramius Ocramius self-assigned this Aug 14, 2020
@Ocramius Ocramius merged commit 06b2902 into laminas:1.2.x Aug 14, 2020
@weierophinney weierophinney deleted the hotfix/changelog-commits branch August 14, 2020 13:59
weierophinney added a commit that referenced this pull request Aug 14, 2020
Updates CHANGELOG.md file with info on fix introduced in #55.

Signed-off-by: Matthew Weier O'Phinney <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants