Skip to content
This repository was archived by the owner on Apr 9, 2021. It is now read-only.

Username/AccessToken provided via Environment variables - #13

Merged
jehiah merged 1 commit into
bitly:masterfrom
ianozsvald:master
Jan 11, 2013
Merged

jehiah merged 1 commit into
bitly:masterfrom
ianozsvald:master

Conversation

@ianozsvald

Copy link
Copy Markdown
Contributor

Username and AccessToken are imported using environment variables. If they're missing then a useful error is raised. README updated to explain how to set this up, doc added in test_bitly_api.py to explain how to run the test.

One test changed in test_bitly_api as the 'test1' key is a valid bitly key, maybe this entered the keyspace? I've added a longer random string, I don't know if this keeps the same meaning to the test (this needs validation).

Comment thread test/test_bitly_api.py Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

when using an OAuth access token, this bitly_username is completely ignored. The tests pass for me w/o that, so i think if you drop that block of code we'll be good to go.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Good spot - have removed, also tidied some pep8 points.

@jehiah

jehiah commented Jan 11, 2013

Copy link
Copy Markdown
Member

awesome. changes look good.

before merging, we prefer to squash changes down to a single commit. Would you mind doing that here?

@ianozsvald

Copy link
Copy Markdown
Contributor Author

You're welcome to try on my behalf, this is beyond my git-fu. I tried this https://github.com/ginatrapani/todo.txt-touch/wiki/Squash-All-Commits-Related-to-a-Single-Issue-into-a-Single-Commit and now I have HEAD, develop and two other branches, all in broken states. You're welcome to take my changes and merge them under your own user if that's easier.

@jehiah

jehiah commented Jan 11, 2013

Copy link
Copy Markdown
Member

sorry, yeah, squashing is annoying sometimes.

The workflow I normally use to squash is

# add bitly as a remote (if you don't have it already)
$ git remote add bitly https://github.com/bitly/bitly-api-python.git
$ git fetch bitly
# interactive rebase; leaving the first commit with 'pick' and switching the rest to 'squash'
$ git rebase --interactive bitly/master

Then after a successful squash, it obviously requires a force push up to github because history has changed.

If you want to try again after restting hard to your remote (git reset --hard origin/master) go ahead, otherwise i'll be happy to push a squashed commit to your branch and we can close this out.

…s now use get_connection to fetch user credentials from environment variables

updated doc to include notes on running the tests

updated doc to include notes on running the tests

removed unnecessary username

pep8 pedantry
@ianozsvald

Copy link
Copy Markdown
Contributor Author

Ok, I tried:
$ mv bitly-api-python bitly-api-python-bitbarfed # push old out of the way
$ git clone [email protected]:ianozsvald/bitly-api-python.git # get fresh copy
$ git rebase -i HEAD~5 # following https://github.com/ginatrapani/todo.txt-touch/wiki/Squash-All-Commits-Related-to-a-Single-Issue-into-a-Single-Commit
pick 499454a testExpand required a new key (test1 existed in bitly), all 4 methods now use get_connection to fetch user credentials from environment variables
squash aeb9e42 updated doc to include notes on running the tests
squash 090bff9 updated doc to include notes on running the tests
squash b7a2db4 removed unnecessary username
squash 6dd6a47 pep8 pedantry
I changed the last 4 from 'pick' to 'squash'
$ $ git push origin master --force # force it up (I missed this step before)

It looks like it works, please confirm?

jehiah added a commit that referenced this pull request Jan 11, 2013
Username/AccessToken provided via Environment variables
@jehiah
jehiah merged commit 11a2d9c into bitly:master Jan 11, 2013
@jehiah

jehiah commented Jan 11, 2013

Copy link
Copy Markdown
Member

that did it. thanks for the contribution!

deletedcu added a commit to deletedcu/bitly-api-python that referenced this pull request May 17, 2019
Username/AccessToken provided via Environment variables
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Development

Successfully merging this pull request may close these issues.

2 participants