Giter Club home page Giter Club logo

spec-factory's Introduction

This repository enables repositories of WHATWG standards to be organized centrally to a certain extent. This is useful for the support files (the files with the .template and .template-part extensions), which are often nearly identical and prone to errors.

factory.py takes care of updating existing WHATWG standard repositories. It assumes they are in parallel directories using their "shortname" as directory name. factory.json supplies data for a exceptional cases.

spec-factory's People

Contributors

annevk avatar domenic avatar exe-boss avatar foolip avatar jyasskin avatar lucacasonato avatar ms2ger avatar saschanaz 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  avatar  avatar  avatar  avatar

Watchers

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

spec-factory's Issues

`make local/remote` need the COMMIT-SHA macro

The local and remote targets of the Makefile template define the SNAPSHOT-LINK text macro, which used to define the "snapshot as of this commit" link in the spec metadata. speced/bikeshed#1635, however, removed any usage of that macro, instead using a new COMMIT-SHA macro for the LS status, which those Makefile targets don't define.

This would be solved by removing the SNAPSHOT-LINK definition and adding one for COMMIT-SHA defining it to be the empty string, for example. However, this would create a link pointing to ./commit-snapshots//, which isn't ideal.

Script silently includes extra changes if a repo has local changes

whatwg/dom#877 includes lots of other changes, where I had a .spec.whatwg.org directory in my dom/ checkout, after a bug fixed in whatwg/whatwg.org#325.

The script should either fail if there are any local changes, or just make fresh copies of all repos. As it is, it assumes you have all repos checkout out alongside spec-factory, but how to keep those up-to-date is an exercise for the reader. Here's the script I've arrived at over time:

#!/bin/bash -e

curl --silent --fail "https://api.github.com/orgs/whatwg/repos?per_page=100" | \
    #grep -E '^    "name":' | cut -d \" -f4 | \
    #grep -vE '^(domparsing|javascript|old-google-code-html5|resources.whatwg.org)$' | \
    jq -r '.[] | select(.archived == false) | .name' | sort | \
    while read name; do
        if [[ -d "$name" ]]; then
            echo "Updating $name"
            (
                cd "$name"
                git fetch --prune
                git rebase-update --no-fetch --keep-going
            )
        else
            echo "Cloning $name"
            git clone "[email protected]:whatwg/$name.git"
        fi
    done

It would be good if it just works instead.

Centralize maintenance of README.md

This requires a bit more discussion I think about what should go in the README and what should go in a local CONTRIBUTING.

Examples that differ:

  • Formatting guidelines
  • Referencing implementations that ought to be fully aligned, such as whatwg-url.

Many other things are extremely consistent though and ought to be the same.

New issue templates broke form prefilling of file-issue.js script

The HTML spec makes use of the file-issue.js script, which provides a "File an issue about the selected text" link in the bottom right corner that when clicked previously opened the issue form prefilled with the selected text:

    return originalFilingURL + '?title=' + encodeURIComponent(bugData.title) + '&body=' +
           encodeURIComponent(bugData.body);

The new issue templates broke this since the body URL param no longer works. Fixing this will require four steps:

  1. Updating the data-file-issue-url= in the HTML source file to include ?template=0-new-issue.yml.
  2. Updating the above code of file-issue.js to preserve existing URL parameters.
  3. Specifying id: issue-body below type: textarea in 0-new-issue.yml. (I tested it and unfortunately GitHub ignores the id if it is set to body.)
  4. Implementing a new data-body-url-param option in file-issue.js and adding data-body-url-param="issue-body" to the HTML source file.

While I took the time to figure this out, I'm not interesting in implementing these steps myself ... I'm busy polishing my HTML parser.

Breakage

Currently there are the following issues. Since we don't run this often it's unclear whether they need to be resolved.

  • Compatibility uses compatibility.bs while its shortname is compat.
  • Makefile.template does not support (do we really only need these for deploy, not review?)
    • EXTRA_FILES
    • POST_BUILD_STEP
  • Console
    • Different .editorconfig (indent_size = 2 rather than 1)
    • Different .gitignore
    • Has no .pr-preview.json
    • Custom Makefile (does not seem to be needed other than EXTRA_FILES though)
  • Encoding needs /UnicodeData.txt in .gitignore.
  • HTML is mostly incompatible as expected
    • Weird that it has indent_size = 2 and no max_line_length = 100.
    • No .gitignore. Probably because building is done elsewhere.
  • Streams
    • Minor .editorconfig mismatches again.
    • Needs `.gitignore additions
    • Has "post_processing" member in .pr-preview.json, but also seems to have some errors there (e.g., does not overwrite h1).
    • Makefile is custom as there's a node dependency.

Overall it works pretty well though (for 10 out of 15, and for the remaining 5 it still helps identifying issues) and ends up adding PULL_REQUEST_TEMPLATE.md to a bunch of places as well as making minor ordering changes to .gitignore.

Script asks for username if one has a fork of any repo (even if not added as a remote)

I've seen this with the GitHub Actions updates, and now for #18.

This is the full log before it got stuck:

$ python3 factory.py 
Enumerating objects: 5, done.
Counting objects: 100% (5/5), done.
Delta compression using up to 16 threads
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 368 bytes | 368.00 KiB/s, done.
Total 3 (delta 2), reused 0 (delta 0), pack-reused 0
remote: Resolving deltas: 100% (2/2), completed with 2 local objects.
remote: 
remote: Create a pull request for 'meta-template/cfba3326-b9e4-11ea-afa6-acde48001122' on GitHub by visiting:
remote:      https://github.com/whatwg/compat/pull/new/meta-template/cfba3326-b9e4-11ea-afa6-acde48001122
remote: 
To github.com:whatwg/compat.git
 * [new branch]      HEAD -> meta-template/cfba3326-b9e4-11ea-afa6-acde48001122
Branch 'meta-template/cfba3326-b9e4-11ea-afa6-acde48001122' set up to track remote branch 'meta-template/cfba3326-b9e4-11ea-afa6-acde48001122' from 'origin'.
https://github.com/whatwg/compat/pull/129


A new release of gh is available: 0.10.0 → v0.10.1
https://github.com/cli/cli/releases/tag/v0.10.1

Enumerating objects: 5, done.
Counting objects: 100% (5/5), done.
Delta compression using up to 16 threads
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 368 bytes | 368.00 KiB/s, done.
Total 3 (delta 2), reused 0 (delta 0), pack-reused 0
remote: Resolving deltas: 100% (2/2), completed with 2 local objects.
remote: 
remote: Create a pull request for 'meta-template/d50e4d8a-b9e4-11ea-afa6-acde48001122' on GitHub by visiting:
remote:      https://github.com/whatwg/console/pull/new/meta-template/d50e4d8a-b9e4-11ea-afa6-acde48001122
remote: 
To github.com:whatwg/console.git
 * [new branch]      HEAD -> meta-template/d50e4d8a-b9e4-11ea-afa6-acde48001122
Branch 'meta-template/d50e4d8a-b9e4-11ea-afa6-acde48001122' set up to track remote branch 'meta-template/d50e4d8a-b9e4-11ea-afa6-acde48001122' from 'origin'.
https://github.com/whatwg/console/pull/184


A new release of gh is available: 0.10.0 → v0.10.1
https://github.com/cli/cli/releases/tag/v0.10.1

Enumerating objects: 15, done.
Counting objects: 100% (15/15), done.
Delta compression using up to 16 threads
Compressing objects: 100% (10/10), done.
Writing objects: 100% (13/13), 276.79 KiB | 2.64 MiB/s, done.
Total 13 (delta 4), reused 0 (delta 0), pack-reused 0
remote: Resolving deltas: 100% (4/4), completed with 2 local objects.
remote: 
remote: Create a pull request for 'meta-template/dcf254c4-b9e4-11ea-afa6-acde48001122' on GitHub by visiting:
remote:      https://github.com/whatwg/dom/pull/new/meta-template/dcf254c4-b9e4-11ea-afa6-acde48001122
remote: 
To github.com:whatwg/dom.git
 * [new branch]      HEAD -> meta-template/dcf254c4-b9e4-11ea-afa6-acde48001122
Branch 'meta-template/dcf254c4-b9e4-11ea-afa6-acde48001122' set up to track remote branch 'meta-template/dcf254c4-b9e4-11ea-afa6-acde48001122' from 'origin'.
https://github.com/whatwg/dom/pull/877


A new release of gh is available: 0.10.0 → v0.10.1
https://github.com/cli/cli/releases/tag/v0.10.1

Enumerating objects: 5, done.
Counting objects: 100% (5/5), done.
Delta compression using up to 16 threads
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 369 bytes | 369.00 KiB/s, done.
Total 3 (delta 2), reused 0 (delta 0), pack-reused 0
remote: Resolving deltas: 100% (2/2), completed with 2 local objects.
remote: 
remote: Create a pull request for 'meta-template/e246f10a-b9e4-11ea-afa6-acde48001122' on GitHub by visiting:
remote:      https://github.com/whatwg/encoding/pull/new/meta-template/e246f10a-b9e4-11ea-afa6-acde48001122
remote: 
To github.com:whatwg/encoding.git
 * [new branch]      HEAD -> meta-template/e246f10a-b9e4-11ea-afa6-acde48001122
Branch 'meta-template/e246f10a-b9e4-11ea-afa6-acde48001122' set up to track remote branch 'meta-template/e246f10a-b9e4-11ea-afa6-acde48001122' from 'origin'.
https://github.com/whatwg/encoding/pull/222


A new release of gh is available: 0.10.0 → v0.10.1
https://github.com/cli/cli/releases/tag/v0.10.1

Enumerating objects: 5, done.
Counting objects: 100% (5/5), done.
Delta compression using up to 16 threads
Compressing objects: 100% (3/3), done.
Writing objects: 100% (3/3), 366 bytes | 366.00 KiB/s, done.
Total 3 (delta 2), reused 0 (delta 0), pack-reused 0
remote: Resolving deltas: 100% (2/2), completed with 2 local objects.
remote: 
remote: Create a pull request for 'meta-template/e79833e4-b9e4-11ea-afa6-acde48001122' on GitHub by visiting:
remote:      https://github.com/whatwg/fetch/pull/new/meta-template/e79833e4-b9e4-11ea-afa6-acde48001122
remote: 
To github.com:whatwg/fetch.git
 * [new branch]      HEAD -> meta-template/e79833e4-b9e4-11ea-afa6-acde48001122
Branch 'meta-template/e79833e4-b9e4-11ea-afa6-acde48001122' set up to track remote branch 'meta-template/e79833e4-b9e4-11ea-afa6-acde48001122' from 'origin'.
https://github.com/whatwg/fetch/pull/1046


A new release of gh is available: 0.10.0 → v0.10.1
https://github.com/cli/cli/releases/tag/v0.10.1

Username for 'https://github.com':

I don't understand why fetch was different. My only remote is [email protected]:whatwg/fetch.git. I also don't have a personal fork of the repo, which I first suspected might make it different.

@annevk have you seen this?

Make factory.py help with setting up a new repository

This was an idea initially, but if we create a repository containing a .bs resource and add the new standard to db.json this would take care of that automatically.

I suppose we could make it take care of the .bs resource.

Add MDN issue to PR template

https://github.com/whatwg/spec-factory/blob/main/PULL_REQUEST_TEMPLATE.md.template should be updated with a new checklist item like:

- [ ] [MDN Issue](https://github.com/whatwg/meta/blob/main/MAINTAINERS.md#handling-pull-requests) is filed (if applicable): …

Then we need to update https://github.com/whatwg/meta/blob/main/MAINTAINERS.md#handling-pull-requests to give the right instructions for documentation.

@sideshowbarker maybe you could work on the whatwg/meta changes first?

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.