Skip to content
This repository has been archived by the owner on Jul 13, 2023. It is now read-only.

Make a post of every release? #31

Closed
axic opened this issue Apr 15, 2020 · 13 comments
Closed

Make a post of every release? #31

axic opened this issue Apr 15, 2020 · 13 comments
Labels
question Further information is requested

Comments

@axic
Copy link
Member

axic commented Apr 15, 2020

I think if we were to do this, it should contain the short intro from the release page (and perhaps the changelog) and the link to the release. But I wouldn't copy paste the entire release page with all the different links.

Any opinions?

Also not suggesting we should do this retroactively for every release, but we may as well if it can be automated. Probably there is a github API to download the release text.

@chriseth
Copy link
Contributor

Sounds good! Should we include the changelog or not?
At some point, we might also have a table with all releases on solidity.ethereum.org - github only lists them in the order of publication, not sorted by version.

@franzihei
Copy link
Member

franzihei commented May 12, 2020

I can offer to start creating a small blog post for every release, similar like we tweet about every release. It should not include too much text though, should it?

@franzihei franzihei added the question Further information is requested label May 12, 2020
@chriseth
Copy link
Contributor

Sounds good!

@franzihei
Copy link
Member

franzihei commented May 25, 2020

I think we decided to have a small release announcement for every release now, we started with 0.6.8 (here: https://solidity.ethereum.org/2020/05/14/solidity-068-release-announcement/). I can be in charge of putting it together / reminding us that we want to write one each time.

@axic
Copy link
Member Author

axic commented May 25, 2020

This issue was also suggesting that we could create a script pulling from github release page and pushing it to the blog.

Should we keep it open for that for a tiny bit longer?

@franzihei franzihei reopened this May 25, 2020
@franzihei
Copy link
Member

I don't think it's a good idea to "automate" release announcements like that since we might want to outline things more in the blog post, e.g. in the last one we outlined the three bugs in more detail. Or what are you suggesting?

@axic
Copy link
Member Author

axic commented May 25, 2020

The release page on github was always written like a blog post, highlighting the important parts. I know recently highlighting on the blog became even more emphasized, but still, the old release notes were trying to fill in the same gap. (They are not just a copy paste from the CHANGELOG file.)

The suggestion here is to have a script which pulls the release page and creates a blog entry for each for the past releases.

I wasn't suggesting to use it for any new release, but I guess it could be.

Also didn't suggest to run it in the background, but rather someone had to run it once :)

@axic
Copy link
Member Author

axic commented Jun 2, 2020

Here's the API to download release notes: https://developer.github.com/v3/repos/releases/

For example https://api.github.com/repos/ethereum/solidity/releases/tags/v0.6.7 contains the body which could be used as the blog post body.

@axic
Copy link
Member Author

axic commented Jun 5, 2020

Here's my script:

#!/usr/bin/env node

var https = require('https')
var MemoryStream = require('memorystream')
var fs = require('fs')

function getReleaseNotes(version, cb) {
  var mem = new MemoryStream(null, { readable: false });
  https.get(
    'https://api.github.com/repos/ethereum/solidity/releases/tags/' + version,
    { headers: { 'User-Agent': 'Mozilla/5.0' } },
    function (response) {
    if (response.statusCode !== 200) {
      console.log('Error downloading file: ' + response.statusCode);
      process.exit(1)
    }
    response.pipe(mem);
    response.on('end', function () {
      cb(mem.toString())
    })
  })
}

function createNote(version, date, body) {
  var note = `---
layout: post
published: true
title: 'Solidity ${version} Release Announcement'
date: '${date}'
author: Solidity Team
category: Releases
---

${body}

A big thank you to all contributors who helped make this release possible!

Download the new version of Solidity [here](https://github.com/ethereum/solidity/releases/tag/v${version}).`

  fs.writeFileSync(`${date}-solidity-${version}-release-announcement.md`, note)
}

function processVersion(version) {
  console.log(`Creating note for ${version}`)
  getReleaseNotes('v' + version, function (releaseNote) {
    // Assume this works.
    releaseNote = JSON.parse(releaseNote)

    var body = releaseNote.body
    // Replace DOS newlines
    body = body.replace(/(\r\n)/gm, '\n')
    // Strip separators, `---` or `----`
    body = body.replace(/(\-\-\-*)/gm, '')
    // Replace too many consecutive new lines
    //body = body.replace(/(\n\n\n+)/gm, '\n')
    // Strip stuff after 'We especially thank'
    body = body.replace(/(We especially thank[\s\S]*)$/gm, '')
    // Strip stuff after 'If you want to perform a source build'
    body = body.replace(/(If you want to perform a source build[\s\S]*)$/gm, '')
    // Strip stuff after `----` in the release notes
    //body = body.replace(/(\-\-\-\-\n\nWe especially[\s\S]*)$/gm, '')
    // Replace first mention with URL
    body = body.replace(`Solidity version ${version}`, `[Solidity v${version}](https://github.com/ethereum/solidity/releases/tag/v${version})`)
    body = body.replace(`^Solidity ${version}`, `[Solidity v${version}](https://github.com/ethereum/solidity/releases/tag/v${version})`)
  
    var date = releaseNote.published_at.match(/\d\d\d\d-\d\d-\d\d/)[0]

    createNote(version, date, body)
  })
}


// Covered with blog posts: 0.4.11 (somewhat), 0.4.25, 0.5.10, 0.6.5 (somewhat)

// 0.1.2 -- 0.1.7
// 0.2.0 -- 0.2.2
// 0.3.0 -- 0.3.6
// 0.4.0 -- 0.4.26
// 0.5.0 -- 0.5.17
// 0.6.0 -- 0.6.7 (0.6.8/9 has its own post)

processVersion('0.4.26')

@franzihei
Copy link
Member

Looks good from what I can tell, @chriseth can you also have a look so that we can move forward? :)

@chriseth
Copy link
Contributor

looks good

@franzihei
Copy link
Member

franzihei commented Jun 15, 2020

Minor comment, there are two spaces between helped and make in this sentence: A big thank you to all contributors who helped make this release possible!.

@axic
Copy link
Member Author

axic commented Jun 16, 2020

That was fixed locally, just forgot to push here (also added some other things, iirc).

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

3 participants