Giter VIP home page Giter VIP logo

repo-tools's Introduction

Open edX Repo Tools

This repo contains a number of tools Open edX engineers use for working with GitHub repositories.

The set of tools has grown over the years. Some are old and in current use, some have fallen out of use, some are quite new.

Setting up GitHub authentication

Most of these make GitHub API calls, and so will need GitHub credentials in order to not be severely rate-limited. Edit (or create) ~/.netrc so that it has an entry like this:

machine api.github.com
  login your_user_name
  password ghp_XyzzyfGXFooBar8nBqQuuxY9brgXYz4Xyzzy

Change the login to your GitHub user name. The password is a Personal Access Token you get from https://github.com/settings/tokens. Visit that page, click "Generate new token." It will prompt you for your password, then you'll see a scary list of scopes. Check the "repo" option and click "Generate token." Copy the token that appears. Paste it into your ~/.netrc in the "password" entry.

Working in the repo

To work on these tools:

  1. Use a virtualenv.

  2. Install dependencies:

    make dev-install
    
  3. Run tests:

    make test
    
  4. Older tools were Python files run from the root of the repo. Now we are being more disciplined and putting code into importable modules with entry points in setup.py.

  5. Simple tools can go into an existing subdirectory of edx_repo_tools. Follow the structure of existing tools you find here. More complex tools, or ones that need unusual third-party requirements, should go into a new subdirectory of edx_repo_tools.

  6. Add a new entry_point in setup.py for your command:

    entry_points={
        'console_scripts': [
            ...
            'new_tool = edx_repo_tools.new_tool_dir.new_tool:main',
            ...
    
  7. If your tool is in its own directory, you can create an extra.in file there with third-party requirements intended just for your tool. This will automatically create an installable "extra" for your requirements.

Older Tools

There are many programs in this repo in various stages of disrepair. A few of them are described in this repo's older README.md file. Others are not described at all, but may be useful, or have useful tidbits in the code.

Feedback

Please send any feedback to [email protected].

repo-tools's People

Contributors

adampalay avatar adzuci avatar aht007 avatar arbrandes avatar awais786 avatar bderusha avatar bmedx avatar cclauss avatar cpennington avatar edx-requirements-bot avatar feanil avatar filosottile avatar gsong avatar iamsobanjaved avatar jawayria avatar jdmulloy avatar jibsheet avatar jinder1s avatar jtauber avatar maxrothman avatar mduboseedx avatar michaelyoungstrom avatar morenol avatar mraarif avatar nedbat avatar regisb avatar sarina avatar singingwolfboy avatar timmc-edx avatar usamasadiq avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

repo-tools's Issues

Be smarter about where repos are located

@jristau1984 currently we're going through and updating all references to repos that are written as in the edx org to be properly in the openedx org. I notice in this repo that there are assumptions that all repos are in the edx org. This tool should be smarter: repos that are in the openedx org should be treated as such. This guards against the future, for example if someone makes a fork of a repo into the edx org accidentally, then the url forwarding won't work anymore.

cc @nedbat

Path to script_to_replace_static.sh

So the replace_state command assumes that the package is installed in the ./edx_repo_tools.
https://github.com/edx/repo-tools/blob/ac23287f3dc2aaa70d432a2812efac226882d2d4/edx_repo_tools/codemods/django3/replace_static.py#L13
However this wasn't the case for me, I had to copy the file to make it work, so I wonder did I not install this repo correctly? I just installed as follow python setup.py install. Or do we need to update the path for the subprocess command

script failed with trailing comma in a field

At the end there is a trailing comma and script failed on it.

models.OneToOneField('ArticleRevision',verbose_name=_(u'current revision'),blank=True, null=True, related_name='current_set' ,)
Here is a complete traceback
-    current_revision = models.OneToOneField('ArticleRevision',verbose_name=_(u'current revision'),blank=True, null=True, related_name='current_set',)
+    current_revision = models.OneToOneField('ArticleRevision',verbose_name=_(u'current revision'),blank=True, null=True, related_name='current_set',, on_delete=models.CASCADE)

     created = models.DateTimeField(auto_now_add=True, verbose_name=_(u'created'))
     modified = models.DateTimeField(auto_now=True, verbose_name=_(u'modified'),
ERR:tool.py:216  Bowler exception during transform of /Users/abc/Documents/devstack/django-wiki/wiki/plugins/attachments/models.py: Transforms generated invalid CST for /Users/abc/Documents/devstack/django-wiki/wiki/plugins/attachments/models.py
Traceback (most recent call last):
  File "/Users/abc/.virtualenvs/repo-toolspy37/lib/python3.7/site-packages/bowler/tool.py", line 145, in processed_file
    new_tree = self.driver.parse_string(new_text)
  File "/Users/abc/.virtualenvs/repo-toolspy37/lib/python3.7/site-packages/fissix/pgen2/driver.py", line 102, in parse_string
    return self.parse_tokens(tokens, debug)
  File "/Users/abc/.virtualenvs/repo-toolspy37/lib/python3.7/site-packages/fissix/pgen2/driver.py", line 71, in parse_tokens
    if p.addtoken(type, value, (prefix, start)):
  File "/Users/abc/.virtualenvs/repo-toolspy37/lib/python3.7/site-packages/fissix/pgen2/parse.py", line 164, in addtoken
    raise ParseError("bad input", type, value, context)
fissix.pgen2.parse.ParseError: bad input: type=12, value=',', context=('', (24, 148))

The above exception was the direct cause of the following exception:

It adds double comma

+    current_revision = models.OneToOneField('ArticleRevision',verbose_name=_(u'current revision'),blank=True, null=True, related_name='current_set'
,, 
on_delete=models.CASCADE)

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.