Skip to content
This repository was archived by the owner on Dec 15, 2023. It is now read-only.

Conversation

@jo2y
Copy link
Contributor

@jo2y jo2y commented Mar 11, 2018

Related to #10

@pmbethe09 offered to do the review. If you want, I can try to break this up into smaller PRs.

@pmbethe09
Copy link
Contributor

If you can break it up great, if not also ok. I am backlogged on a few things so it will take me a day before I can get to this.


load("//appengine:appengine.bzl", "appengine_repositories")
appengine_repositories()
load("//appengine:java_appengine.bzl", "java_appengine_repositories")
Copy link
Contributor

Choose a reason for hiding this comment

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

prefer to group loads first

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Done. It would be nice if buildifier did that for me.

"${JVM_FLAGS_CMDLINE[@]}"
"-Dappengine.sdk.root=${APP_ENGINE_ROOT}"
${main_class}
"--disable_update_check"
Copy link
Contributor

Choose a reason for hiding this comment

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

why?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@@ -0,0 +1,289 @@
# Copyright 2015 The Bazel Authors. All rights reserved.
Copy link
Contributor

Choose a reason for hiding this comment

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

is there no way to use 'git mv' to preserve the previous history?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

This is the main reason I did this as several changes in my branch. It works for the first change which was just a rename.
3061013#diff-3b8b4a89deffca2ab1dabfb178ff7012
but every time I made changes to the moved file, git seems to forget the history. At least during the diff.
39266ae#diff-3b8b4a89deffca2ab1dabfb178ff7012

Running this in my client does show the full history back to 2015.
git log --follow appengine/java_appengine.bzl

@pmbethe09
Copy link
Contributor

LGTM

@pmbethe09 pmbethe09 merged commit d25d495 into bazelbuild:master Mar 21, 2018
Copy link
Contributor

@rogerhub rogerhub left a comment

Choose a reason for hiding this comment

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

I suppose there's not much point sending these a week after this was merged, but here are some issues I noticed.

fi

ROOT=$PWD
tmp_dir=$(mktemp -d ${{TMPDIR:-/tmp}}/war.XXXXXXXX)
Copy link
Contributor

Choose a reason for hiding this comment

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

These double curly braces are invalid. They were originally Python string escape sequences and should be unescaped here (below as well).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will fix.

ROOT=$PWD
tmp_dir=$(mktemp -d ${{TMPDIR:-/tmp}}/war.XXXXXXXX)
cp -R $ROOT $tmp_dir
trap "{{ cd ${{root_path}}; rm -rf $tmp_dir; }}" EXIT
Copy link
Contributor

Choose a reason for hiding this comment

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

What's root_path? Doesn't look like it's defined anywhere.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Preexisting issue. I'll have to research what it should have been. Is it even needed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It looks like this section was copied from the java counterpart and ROOT was originally called root_path.


ROOT=$PWD
tmp_dir=$(mktemp -d ${{TMPDIR:-/tmp}}/war.XXXXXXXX)
cp -R $ROOT $tmp_dir
Copy link
Contributor

Choose a reason for hiding this comment

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

Preexisting issue, but these variables should be quoted (below as well).

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Will fix.

fi

else
echo "\033[1;31mERROR:\033[0m Application ID must be provided as first argument
Copy link
Contributor

Choose a reason for hiding this comment

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

Doesn't this need a -e?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

It appears it does. Preexisting issue.

fi

rm -Rf $tmp_dir
trap - EXIT
Copy link
Contributor

Choose a reason for hiding this comment

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

Why not just let the exit handler delete tmp_dir?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I didn't write this, so I don't know.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The trap - EXIT deletes the trap above so the rm defined there doesn't run on exit. This was also copied from the java counterpart, but I don't know why it would replicate the trap. I've removed it in my change and we can discuss it there.

@jo2y
Copy link
Contributor Author

jo2y commented Apr 1, 2018

I'll create another PR to address these.

jo2y added a commit to jo2y/rules_appengine that referenced this pull request Apr 1, 2018
- Quote bash variable when possible.
- Fix an undefined $root_dir
- Remove a redundant rm and let the defined trap handler do it.
- echo -e is needed when trying to display escape codes.
- Remove incorrect {{foo}} double curly braces.
@jo2y jo2y deleted the java_prefix branch April 1, 2018 20:04
jdelfino pushed a commit to jdelfino/rules_appengine that referenced this pull request Aug 15, 2018
- Quote bash variable when possible.
- Fix an undefined $root_dir
- Remove a redundant rm and let the defined trap handler do it.
- echo -e is needed when trying to display escape codes.
- Remove incorrect {{foo}} double curly braces.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants