Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extensions do not have the right license #1769

Open
1 of 18 tasks
abchatra opened this issue Dec 29, 2018 · 5 comments
Open
1 of 18 tasks

Extensions do not have the right license #1769

abchatra opened this issue Dec 29, 2018 · 5 comments
Assignees

Comments

@abchatra
Copy link
Collaborator

abchatra commented Dec 29, 2018

Following approved extensions don't have the MIT license:

No license:

  • Seeed-Studio/pxt-grove null
  • mbitfun/pxt-katakana null
  • chevyng/pxt-ucl-junkrobot null
  • LaboratoryForPlayfulComputation/pxt-BlockyTalkyBLE null
  • pizayanz/pxt-linebeacon null
  • sparkfun/pxt-weather-bit null
  • k8robotics/pxt-k8 null
  • sparkfun/pxt-moto-bit null
  • sparkfun/pxt-gamer-bit null
  • PaulDFoster/pxt-microbit-GY521 null
  • Annikken/pxt-Andee null
  • Tinkertanker/pxt-tinkercademy-microbot null
  • Tinkertanker/pxt-oled-ssd1306 other
  • Tinkertanker/pxt-range-vl53l0x null
  • Tinkertanker/microDriver_SHT2x null
  • Tinkertanker/uDriver_PCA9585 null

Following extensions have some other license

@abchatra abchatra changed the title Extensions do not have right license Extensions do not have right the license Dec 29, 2018
@abchatra
Copy link
Collaborator Author

let fs = require("fs")
let rp = require("request-promise-native");
let s = fs.readFileSync("targetConfig.json")
let config = JSON.parse(s);
let repos = config.packages.approvedRepos;
let orgs = config.packages.approvedOrgs;

async function reqAsync(query) {
 var options = {
    uri:  query,
    headers: {
        'User-Agent': 'Request-Promise'
    },
    qs: {
        access_token: '' // -> uri + '?access_token=xxxxx%20xxxxx'
    },
    resolveWithFullResponse: true,
    json: true 
    }

    resp = await rp(options)
        .then(function (response) {
            return {json: response.body, headers: response.headers};
        })
        .catch(function (err) {
            console.log(err)
        });

    return resp;
}

function toRepoInfo(v) {
    return {
        id: v.id,
        name: v.name,
        full_name: v.full_name,
        private: v.private,
        description: v.description || "",
        fork: v.fork,
        archived: v.archived,
        created_at: v.created_at,
        updated_at: v.updated_at,
        pushed_at: v.pushed_at,
        size: v.size,
        stargazers_count: v.stargazers_count || 0,
        watchers_count: v.watchers_count || 0,
        forks_count: v.forks_count || 0,
        open_issues: v.open_issues || 0,
        default_branch: v.default_branch,
        license: v.license,
        searchData: []
    }
}
console.log(orgs)
async function queryGithub() {
    let allItems = []

    //timestamps is used for create partitions in the query, github throttles above 1000 results.
    //Before Christmas 2018 microbit has 981 packages.
    //This is a point fix, ideally we should only query whitelisted packages from targetconfig.json.
    let timestamps = ["created:<2018-12-26", "created:>2018-12-25"];
    let index = 0;

    let query = `in:name,description,readme "for PXT/microbit"`
    let org = "https://api.github.com/search/repositories" +
        "?q=" + encodeURIComponent(query);
    let url = org +  "+" + encodeURIComponent(timestamps[index]) + "&per_page=100"
    index++;


    while (true) {
        let resp = await reqAsync(url);

        for (let v of resp.json.items) {
            let vv = toRepoInfo(v)

            if (repos.includes(vv.full_name)) {
                allItems.push(vv)
            } else {
                let search = /[a-zA-Z-]*/.exec(vv.full_name);
                if (orgs.includes(search[0])) {
                    allItems.push(vv)
                }
            }
        }

        let m = /<([^>]+)>;\s*rel="next"/.exec(resp.headers["link"])
        if (m) {
            url = m[1]
        } else {
            if (index < timestamps.length) {
                url = org +  "+" + encodeURIComponent(timestamps[index]) + "&per_page=100"
                index++;
            } else {
                break
            }
        }
    }

    return allItems;
}

(async function () {
    let allItems = await queryGithub();
    console.log(allItems.length)
    let count = 0;
    for(let i = 0; i < allItems.length; i++) { 
        if (!allItems[i].license || allItems[i].license.key != "mit") {
            console.log(allItems[i].full_name, allItems[i].license)
            count++;
        }
    }
    console.log("Missing MIT license:" + count);
})();

@abchatra
Copy link
Collaborator Author

abchatra commented Jan 3, 2019

@microbit-mark @jaustin Is it possible to contact the owners and ask for the right license?

@abchatra abchatra changed the title Extensions do not have right the license Extensions do not have the right license Jan 3, 2019
@abchatra
Copy link
Collaborator Author

abchatra commented Jan 8, 2019

@microbit-mark @jaustin

@alankrantas
Copy link

Hello, just saw this so I added the MIT license for https://github.com/jdarling/pxt-pca9685 (pulled request from my forked repository).

@jtcircus
Copy link

jtcircus commented May 5, 2023

I see in the post from Dec 28, 2018 that Sparkfun's Gamerbit does not have the right extension. I'm trying to use this extension in my classroom. Is there a work around? Can I use an older version of the makecode editor to get this hardware working?
Thank you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants