GithubHelp home page GithubHelp logo

workflow notes about loco HOT 32 OPEN

avdd avatar avdd commented on July 28, 2024
workflow notes

from loco.

Comments (32)

avdd avatar avdd commented on July 28, 2024
gh create -a @me -t 'title'

NB set EDITOR=vim to use editor for body (defaults to nano which I have uninstalled)

from loco.

avdd avatar avdd commented on July 28, 2024
branch=$(gh issue view --json number,title -t '{{.number}}-{{.title}}' 4 | tr \  - |tr A-Z a-z)
git checkout -b $branch

from loco.

avdd avatar avdd commented on July 28, 2024
gh issue view N

from loco.

avdd avatar avdd commented on July 28, 2024

Run failing test:

instance=$(docker ps --latest --quiet) # FIXME: ensure this is robust
docker exec -it -u vscode -w /tmp $instance python /workspaces/loco/test.py

Use /tmp as working directory to avoid creating crap (geckodriver.log) in workspace.

from loco.

avdd avatar avdd commented on July 28, 2024

TODO: ensure test run does not conflict with interactive development:

Address already in use
Port 8000 is in use by another program. Either identify and stop that program, or start the server with a different port.

from loco.

avdd avatar avdd commented on July 28, 2024

I tried the --fill option:

gh pr create -d -f

but this created the PR immediately, so no chance to link to the issue #4.

TODO: script this more fully with --title and --body.

from loco.

avdd avatar avdd commented on July 28, 2024

PR #5.

from loco.

avdd avatar avdd commented on July 28, 2024

gh pr create --fill uses the branch history as the PR comment body somewhat redundantly, so we don't want that.

from loco.

avdd avatar avdd commented on July 28, 2024

--draft is good for WIP 👍

from loco.

avdd avatar avdd commented on July 28, 2024

TODO: investigate whether I want to action the "Your master branch isn't protected" warning or dismiss

from loco.

avdd avatar avdd commented on July 28, 2024

TODO: investigate whether I want to action the "Your master branch isn't protected" warning or dismiss

This is for collaborators and I have none.

from loco.

avdd avatar avdd commented on July 28, 2024

TODO: quickly capture these TODOs!

from loco.

avdd avatar avdd commented on July 28, 2024

TODO: quickly capture these TODOs!

Use github issues as catch-all, but use a label for triage:

gh issue create --label todo --title "$*" --body "..."

What to put in the body?

from loco.

avdd avatar avdd commented on July 28, 2024

set BROWSER=~/.local/bin/wslstart.sh

TODO: document wslstart.sh

from loco.

avdd avatar avdd commented on July 28, 2024

TODO: capture dev container workflow in docker wrapper script

from loco.

avdd avatar avdd commented on July 28, 2024

Use unittest discovery:

docker exec -it -u vscode -w /workspaces/loco $instance python -m unittest -v

from loco.

avdd avatar avdd commented on July 28, 2024

After reorganising files out of top-level, the test command is:

docker exec -it -u vscode -w /workspaces/loco $instance python -m unittest discover -s test

from loco.

avdd avatar avdd commented on July 28, 2024

I tried the --fill option:

gh pr create -d -f

but this created the PR immediately, so no chance to link to the issue #4.

TODO: script this more fully with --title and --body.

Mention the issue# in the PR body to link the two, so that merging the PR will close the issue.

gh pr create -d -t '4-summary' -b 'resolves #4'

or after the fact:

gh pr edit -b 'resolves #4' 5

from loco.

avdd avatar avdd commented on July 28, 2024

If using a draft PR (not sure about this, seems like pointless overhead if it's only me) set the status:

gh pr ready 5

then merge:

gh pr merge -m -d 5

from loco.

avdd avatar avdd commented on July 28, 2024
gh create -a @me -t 'title'
gh issue create -a @me -l 'label' -t 'title'

from loco.

avdd avatar avdd commented on July 28, 2024

TODO: ensure test run does not conflict with interactive development:

Address already in use
Port 8000 is in use by another program. Either identify and stop that program, or start the server with a different port.

see #8

from loco.

avdd avatar avdd commented on July 28, 2024

I tried the --fill option:

gh pr create -d -f

but this created the PR immediately, so no chance to link to the issue #4.

TODO: script this more fully with --title and --body.

see #9

from loco.

avdd avatar avdd commented on July 28, 2024

TODO: quickly capture these TODOs!

Use github issues as catch-all, but use a label for triage:

gh issue create --label todo --title "$*" --body "..."

What to put in the body?

see #9

use TODO for body

from loco.

avdd avatar avdd commented on July 28, 2024

set BROWSER=~/.local/bin/wslstart.sh

TODO: document wslstart.sh

see #10

from loco.

avdd avatar avdd commented on July 28, 2024

TODO: capture dev container workflow in docker wrapper script

see #6

from loco.

avdd avatar avdd commented on July 28, 2024

Note: can't create a PR without new commits on the new branch!

from loco.

avdd avatar avdd commented on July 28, 2024

rough workflow probably something like:

gh issue ls
# select issue to work on
N=11
gh issue view $N
gh issue edit --remove-label todo --add-label in-progress $N
branch=$(gh issue view --json number,title -t '{{.number}}-{{.title}}' $N | tr \  - |tr A-Z a-z)
git checkout -b $branch
# some minimal change to start the PR
git commit -av
git push -u origin $branch
gh pr create -a @me -t "$branch" -b "resolve #$N"
# hack further ...
git push
# review work, if ok then:
PR=$(gh pr list -S $branch --json number --jq '.[].number')
gh pr merge -m -d $PR

from loco.

avdd avatar avdd commented on July 28, 2024

comment on issue:

gh issue comment -e $N

remove in-progress label:

gh issue edit --remove-label in-progress $N

from loco.

avdd avatar avdd commented on July 28, 2024

pull merged master:

git checkout master
git pull -p

clean up branch:

git branch -D $branch
git push -d origin $branch

from loco.

avdd avatar avdd commented on July 28, 2024

Latest docker commands

# get the instance id
instance=$(docker ps --latest --quiet)

# run the server
docker exec -it -u vscode -w /tmp $instance python -m loco.main

# run the python tests
docker exec -it -u vscode -w /workspaces/loco $instance python -m unittest discover -s test/server -v

# run the js tests
docker exec -it -u vscode -w /workspaces/loco $instance ./node_modules/.bin/jasmine test/client/test_init.js

from loco.

avdd avatar avdd commented on July 28, 2024

rough workflow probably something like:

thinking that there's no point with the PRs -- just use branches and commit with "closes #N"

from loco.

avdd avatar avdd commented on July 28, 2024

Consolidating so far (non-PR workflow)

# 1. list issues
gh issue ls

# 2. capture a todo item
gh issue create --label todo --title "blah blah" --body TODO

# 3. view issue
gh issue view $N

# 3a. view on the web
gh issue view -w $N

# TODO: triage todo items?

# 4. edit issue body
tf=$(mktemp -t gh-XXXXXXXX.md)
gh issue view --json body -t '{{.body}}' $N > $tf
vi $tf
gh issue edit -F $tf $N
rm $tf

# 5. add comment
gh issue comment -e $N

# 6. start working on an issue
branch=$(gh issue view --json number,title -t '{{.number}}-{{.title}}' $N | tr \  - |tr A-Z a-z)
git checkout -b $branch
git push -u origin $branch
gh issue edit --remove-label todo --add-label in-progress $N

# 7. first commit on branch
git commit -m 'close #$N' # see notes below
git push

# 7a. iterate
git commit -v #...
git push

# 8. complete (TODO: verify these steps)
git checkout master
# will this fast-forward?
git merge $branch
git -d $branch
git push -d origin $branch
git push master
gh issue edit --remove-label in-progress $N

# 8a. close issue if not linked (see below)
commit=$(git rev-parse HEAD)
gh issue close -c "close in $commit" -r completed $N

So although this workflow avoids unnecessary PRs, I'm still not sure how to reliably automate linking the work to the issue.

This workflow appears to suffer from a similar problem as observed above with the PR workflow, in that a commit must be pushed before the stream of work (branch or PR) can be linked to the issue. With this workflow, the issue can only be linked in a commit and I would have to remember to include the magic keyword in some commit message. The merge step may be an opportunity to do the link, I need to check. But that only happens at the end, so WIP branches would remain unlinked unless linked in some commit.

With the PR workflow, a creating a PR requires a new commit on the branch, meaning I cannot create the PR until I have already done some work, and again the linking is done mid-workflow. However at least with the PR workflow, the PR description is a reliable place to include the linking keyword.

Possibly I could create a PR as part of the completion steps, purely for the purpose of the linking. That seems a bit pointless.

Alternatively I could force an empty commit for the sole purpose of the link, i.e. with git commit --allow-empty, either at the start or the end.

The PR workflow is nicer how it neatly presents the commits on the respective branch though...

from loco.

Related Issues (11)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.