Closed beckyjackson closed 3 years ago
DROID should not know anything specific about COGS, but it would be good for DROID to be able to do some clean-up before deleting a branch.
What if before deleting a branch DROID suggested running make clean
? When we use COGS we could have the clean
task run cogs delete --force
or something.
I think running make clean
would be perfect.
Some documentation on conventions for Make targets -- there aren't many, but clean
is one:
https://www.gnu.org/software/make/manual/html_node/Standard-Targets.html#Standard-Targets
@lmcmicu Can you please look into implementing this? I think this would be ideal, but maybe too fancy:
make clean
task existsmake clean
task exists, then below the confirmation message "Are you sure you want to delete the branch foo?" we add a checkbox which is checked by default: "Run make clean
before deleting"make clean
, ignore any errors, and when it's complete delete the branchMaybe you can think of improvements.
I am wondering why 4.ii is needed. Do we expect that the clean may take a long time?
The use case above is a Google Sheets API call we've seen take 10 seconds. I'm slightly worried about the branch being in an ambiguous state between present and absent. But I'm not sure it's worth the trouble.
Ok. I don't think it will be too much trouble to change the button. But just to be clear, it is ok for the make clean
to run in the foreground, correct? (I.e. no output to the console; from the user's point of view it will simply look like the browser tab is loading.)
I was thinking about running it in the background when I wrote my list. But foreground is simpler so let's see if that's good enough. Then there's no point in changing the button. Sorry for the miscommunication about that.
No console. I was deliberately trying to avoid the complexity of showing a console, then allowing for refresh and cancellation or whatever.
Ok thanks. In that case the last commit should be enough to address this issue.
~After clicking "Delete" next to a branch name, the button still says "Delete", not "Checkout" and the branch is not removed from the workspace. When you click the branch name next to "Delete" (after you've tried to delete it), it takes you to the GitHub branch page instead of the DROID branch page.~ I'm going to open a new issue in regards to this to keep the bug & enhancement separate.
~Furthermore, before deleting a branch, if there is a
.cogs
directory in that branch, we should probably runcogs delete -f
somehow (or some equivalent...) so that the Google Sheet isn't out there forever. Otherwise, if we just remove the branch from the workspace, the sheet still exists and the user can't delete it manually because the service account is the owner.~It would be good to run
make clean
when a branch is deleted.