-
Notifications
You must be signed in to change notification settings - Fork 1.4k
[release tool] fix publishing to hashrelease VM #10636
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
Conversation
f17ad4b
to
69ee128
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR ensures that when using rsync
to publish files to the hashrelease VM, the source directory is normalized with a trailing slash so that only its contents (not the directory itself) are copied.
- Moved
srcDir
normalization (trimming and adding/
) intopublishFiles
and updated logs - Adjusted log messages for clarity and consistency
- Updated
rsync
invocation to use the normalizedsrcDir
for SSH publishing
Comments suppressed due to low confidence (2)
release/internal/hashreleaseserver/server.go:97
- [nitpick] The log field label
srcDir
is using the rawh.Source
path, which may not reflect the normalized directory with the trailing slash used byrsync
. Consider computingsrcDir
once and using that variable in all relevant logs for consistency.
"srcDir": h.Source,
release/internal/hashreleaseserver/server.go:125
- [nitpick] In the
publishFiles
Info log,srcDir
is again set to the rawh.Source
. It would be clearer to log the normalizedsrcDir
(with trailing slash) that is actually used in the SSHrsync
command.
"srcDir": h.Source,
logrus.WithFields(logrus.Fields{ | ||
"hashrelease": h.Name, | ||
"srcDir": h.Source, | ||
}).Info("Publishing hashrelease") | ||
}).Info("Publishing hashrelease files") | ||
var allErr error | ||
// publish to the server via SSH | ||
logrus.WithField("hashrelease", h.Name).Debug("Publishing hashrelease via SSH") | ||
srcDir := strings.TrimSuffix(h.Source, "/") + "/" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The normalization of srcDir
is currently done right before the SSH rsync
call, but it’s also needed (and named) in logs above. Consider moving this computation to the top of publishFiles
so you can reuse the same srcDir
variable for both logging and command invocation.
Copilot uses AI. Check for mistakes.
Description
Fix using
rsync
to copy files to the VM by having a trailing slash at the end of the src directory to ensure it copies the content of the src directory into the destination rather than copying the src directory and its content into destination.srcDir
->dest
copiessrcDir
intodest
to be accessed asdest/srcDir/<content>
srDir/
->dest
copies all the content insrcDir
todest
to be accessed astdest/<content>
Related issues/PRs
Todos
Release Note
Reminder for the reviewer
Make sure that this PR has the correct labels and milestone set.
Every PR needs one
docs-*
label.docs-pr-required
: This change requires a change to the documentation that has not been completed yet.docs-completed
: This change has all necessary documentation completed.docs-not-required
: This change has no user-facing impact and requires no docs.Every PR needs one
release-note-*
label.release-note-required
: This PR has user-facing changes. Most PRs should have this label.release-note-not-required
: This PR has no user-facing changes.Other optional labels:
cherry-pick-candidate
: This PR should be cherry-picked to an earlier release. For bug fixes only.needs-operator-pr
: This PR is related to install and requires a corresponding change to the operator.