-
Notifications
You must be signed in to change notification settings - Fork 690
Move ee files from OSS to private repo script #5858
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
@@ -15,6 +16,7 @@ while [[ $# -gt 0 ]]; do | |||
# this to work (commit hooks should prevent this from happening, as well as the fact | |||
# that we're using symlinks by default). | |||
REVERT="YES" | |||
MOVE_NEW_FILES="YES" |
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.
It appears that the -r|--revert
case automatically sets MOVE_NEW_FILES="YES"
, which doesn't align with the expected behavior. This forces the move functionality to run whenever reverting, even if not explicitly requested. Consider removing this line to keep the revert functionality focused on its primary purpose, allowing users to explicitly combine flags when needed.
Spotted by Diamond
Is this helpful? React 👍 or 👎 to let us know.
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.
intended
backend/substitute_ee_code.sh
Outdated
backend_dirpath="${root_dirpath}/backend/" | ||
ee_file="${ce_file/${backend_dirpath}/}" | ||
ee_file="${EE_CODE_DIR}${ee_file}" | ||
if [ ! -f "${ee_file}" ]; then\ |
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.
There's a trailing backslash at the end of this condition that should be removed:
if [ ! -f "${ee_file}" ]; then\
Should be:
if [ ! -f "${ee_file}" ]; then
The backslash is typically used for line continuation in shell scripts, but it's unnecessary here and could cause syntax errors since the line already ends with a complete shell construct.
if [ ! -f "${ee_file}" ]; then\ | |
if [ ! -f "${ee_file}" ]; then\ |
Spotted by Diamond
Is this helpful? React 👍 or 👎 to let us know.
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.
Caution
Changes requested ❌
Reviewed everything up to 7b7bfc4 in 2 minutes and 33 seconds. Click for details.
- Reviewed
69
lines of code in2
files - Skipped
0
files when reviewing. - Skipped posting
7
draft comments. View those below. - Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. backend/.ignore:1
- Draft comment:
Clarify the '!*ee.rs' pattern – is it intended to unignore EE files? A comment explaining its purpose is recommended. - Reason this comment was not posted:
Confidence changes required:50%
<= threshold50%
None
2. backend/substitute_ee_code.sh:19
- Draft comment:
Setting MOVE_NEW_FILES=YES in the revert (-r/--revert) branch couples two behaviors; confirm this is intended. - Reason this comment was not posted:
Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 10% vs. threshold = 50% The comment is asking the author to "confirm this is intended" which violates our rules about not asking for confirmations or explanations. The coupling appears intentional based on the code structure and comments. There's no clear bug or improvement being suggested. Maybe the coupling really is problematic and could cause issues in some scenarios? Maybe there should be a way to revert without moving files? While separating the behaviors could provide more flexibility, the current coupling appears intentional by design. Without strong evidence that this causes problems, we shouldn't question the design choice. Delete the comment as it merely asks for confirmation of intended behavior rather than suggesting a concrete improvement or pointing out a clear issue.
3. backend/substitute_ee_code.sh:72
- Draft comment:
Quote the variable in the rm command (e.g. "rm "${ce_file}"") to safely handle filenames with spaces. - Reason this comment was not posted:
Confidence changes required:50%
<= threshold50%
None
4. backend/substitute_ee_code.sh:60
- Draft comment:
Consider using a while-read loop or find with -print0/xargs -0 to process files, improving handling of filenames containing spaces. - Reason this comment was not posted:
Confidence changes required:50%
<= threshold50%
None
5. backend/substitute_ee_code.sh:36
- Draft comment:
Typographical error: In the comment "By defaults, it assumes...", "defaults" should be changed to "default". - Reason this comment was not posted:
Comment was on unchanged code.
6. backend/substitute_ee_code.sh:94
- Draft comment:
Typo: The trailing backslash at the end of the line (after theif [ ! -f "${ee_file}" ]; then
) looks unintentional. Consider removing it to avoid unexpected behavior. - Reason this comment was not posted:
Marked as duplicate.
7. backend/substitute_ee_code.sh:99
- Draft comment:
Typo: The echoed string appears to be missing a closing quote around${ce_file}
. It might be intended to beecho "File moved '${ce_file}' -->> '${ee_file}'"
instead ofecho "File moved '${ce_file} -->> '${ee_file}'"
. - Reason this comment was not posted:
Marked as duplicate.
Workflow ID: wflow_KEaCUbcRNqMJVCT3
You can customize by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.
backend/substitute_ee_code.sh
Outdated
backend_dirpath="${root_dirpath}/backend/" | ||
ee_file="${ce_file/${backend_dirpath}/}" | ||
ee_file="${EE_CODE_DIR}${ee_file}" | ||
if [ ! -f "${ee_file}" ]; then\ |
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.
Remove the stray backslash at the end of the if condition to prevent syntax errors.
if [ ! -f "${ee_file}" ]; then\ | |
if [ ! -f "${ee_file}" ]; then |
backend/substitute_ee_code.sh
Outdated
if [ ! "$REVERT" == "YES" ]; then | ||
ln -s "${ee_file}" "${ce_file}" | ||
fi | ||
echo "File moved '${ce_file} -->> '${ee_file}'" |
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.
Fix the echo quoting; likely intended to be: "File moved '${ce_file}' -->> '${ee_file}'"
.
echo "File moved '${ce_file} -->> '${ee_file}'" | |
echo "File moved '${ce_file}' -->> '${ee_file}'" |
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.
Caution
Changes requested ❌
Reviewed everything up to 95b3f4c in 2 minutes and 7 seconds. Click for details.
- Reviewed
69
lines of code in2
files - Skipped
0
files when reviewing. - Skipped posting
5
draft comments. View those below. - Modify your settings and rules to customize what types of comments Ellipsis leaves. And don't forget to react with 👍 or 👎 to teach Ellipsis.
1. backend/.ignore:1
- Draft comment:
Add a trailing newline for POSIX compliance. - Reason this comment was not posted:
Comment did not seem useful. Confidence is useful =0%
<= threshold50%
This comment is purely informative, suggesting a change for POSIX compliance. It doesn't ask for a specific code change or highlight a potential issue with the current code.
2. backend/substitute_ee_code.sh:19
- Draft comment:
Avoid setting MOVE_NEW_FILES=YES in the revert branch; mixing revert and move actions may lead to unintended file moves. - Reason this comment was not posted:
Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 10% vs. threshold = 50% The code appears intentionally designed to handle both operations together. The move operation has a specific check if [ ! "$REVERT" == "YES" ] that creates symlinks only when not reverting. This suggests the interaction between revert and move was carefully considered. The comment seems to be speculating about potential issues without strong evidence of a problem. I could be missing some edge cases where the combination of operations could cause issues. The code's behavior might be more complex than it appears. The code explicitly handles the revert+move combination with conditional logic, suggesting this is an intended feature rather than a bug. Without clear evidence of an actual issue, this comment appears speculative. Delete the comment as it appears to be speculating about potential issues without strong evidence, and the code seems intentionally designed to handle both operations together.
3. backend/substitute_ee_code.sh:72
- Draft comment:
Quote the variable in the rm command (use rm "${ce_file}") to safely handle filenames with spaces. - Reason this comment was not posted:
Comment was on unchanged code.
4. backend/substitute_ee_code.sh:89
- Draft comment:
Consider using 'find -print0' with a while-read loop to safely handle filenames containing spaces. - Reason this comment was not posted:
Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 20% vs. threshold = 50% While this is technically correct advice, we need to consider: 1) Is this a real issue for this codebase? 2) The files being processed are *.ee.rs files, which are likely to follow standard naming conventions without spaces 3) This is an internal developer tool script, not customer-facing code 4) The change would make the code more complex for marginal benefit The comment points out a legitimate shell scripting issue that could cause problems in edge cases. Not fixing it could lead to bugs if file naming conventions change. Given this is an internal tool dealing with specifically named *.ee.rs files, the likelihood of spaces in filenames is extremely low. The added complexity isn't worth it for this use case. While technically correct, this comment suggests a complex change to handle an edge case that's extremely unlikely in this context. The comment should be removed.
5. backend/.ignore:1
- Draft comment:
The file is missing a newline at the end. Please ensure that the file ends with a newline character. - Reason this comment was not posted:
Decided after close inspection that this draft comment was likely wrong and/or not actionable: usefulness confidence = 10% vs. threshold = 50% This is a style issue that would typically be caught by linters or formatters. The comment starts with "Ensure that..." which is a red flag according to our rules. Missing newlines at end of file are usually automatically fixed by dev tools. This seems like a trivial issue that doesn't warrant manual intervention. Missing newlines can sometimes cause issues with certain tools or in certain environments. The comment is technically correct about best practices. While technically correct, this is exactly the kind of trivial issue that should be handled by automated tools rather than manual review comments. The rules explicitly state not to make comments that start with "Ensure that..." Delete this comment as it violates the rule about "Ensure that..." comments and is too trivial an issue to warrant manual intervention.
Workflow ID: wflow_Jf7zSRekpyaKc6Zy
You can customize by changing your verbosity settings, reacting with 👍 or 👎, replying to comments, or adding code review rules.
ee_file="${ce_file/${backend_dirpath}/}" | ||
ee_file="${EE_CODE_DIR}${ee_file}" | ||
if [ ! -f "${ee_file}" ]; then | ||
mv "${ce_file}" "${ee_file}" |
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.
Ensure the target directory for the moved file exists (e.g., use mkdir -p $(dirname "${ee_file}")
) before executing mv
.
mv "${ce_file}" "${ee_file}" | |
mkdir -p "$(dirname \"${ee_file}\")" && mv "${ce_file}" "${ee_file}" |
allows to do ./substitute_ee_code --move-new-files (or -m), which will copy newly created ee files from the oss repo to the private repo, and replace them with a symlink
Important
Add
--move-new-files
option to move new EE files from OSS to private repo and update.ignore
to ignore*ee.rs
files.--move-new-files
(-m
) option tosubstitute_ee_code.sh
to move new EE files from OSS to private repo and replace with symlinks..ignore
to ignore all*ee.rs
files.substitute_ee_code.sh
, checks forMOVE_NEW_FILES
flag to move files and create symlinks if not reverting.--dir
option to specify private repo path.This description was created by
for 95b3f4c. You can customize this summary. It will automatically update as commits are pushed.