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

release blog: generate release post without content #85

Merged
merged 11 commits into from
Dec 4, 2024

Conversation

otegami
Copy link
Contributor

@otegami otegami commented Dec 4, 2024

GitHub: GH-83

In this PR, we implement a Rake task for generating release announces in blog without contents.
At the following PRs, we will implement contents step by step.

Generate release posts

$ rake release:blog:generate
$ tree . | grep 2024-12-04-groonga-14.1.0.md
  │      └── 2024-12-04-groonga-14.1.0.md
  │   │  └── 2024-12-04-groonga-14.1.0.md

GitHub: groongaGH-83

In this PR, we implement a Rake task for generating release
announces in blog without contents.
At the following PRs, we will implement contents step by step.

Generate release announces

```console
$ VERSION=14.1.1 rake release:blog:generate
$ tree . | grep 2024-12-04-groonga-14.1.1.md
  │      └── 2024-12-04-groonga-14.1.1.md
  │   │  └── 2024-12-04-groonga-14.1.1.md
```
Rakefile Outdated Show resolved Hide resolved
Because the version is updated when we generate the release posts.
release_task.rb Outdated
end
end
end
end

def post_filename
"#{Time.now.strftime("%F")}-#{@package.downcase}-#{@version}.md"
Copy link
Member

Choose a reason for hiding this comment

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

Time.now_config.ymlから持ってこれませんか?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fix: 25ca18c...2c29500 共通して使いまわせそうだったので、_config.ymlから取得するように修正しました。

release_task.rb Outdated
Comment on lines 18 to 19
require "yaml"
require "date"
Copy link
Member

Choose a reason for hiding this comment

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

ソートしてください。

Suggested change
require "yaml"
require "date"
require "date"
require "yaml"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fix: a2662b0

release_task.rb Outdated
Comment on lines 42 to 46
jekyll_config["#{@package.downcase}_version"]
end

def detect_release_date
jekyll_config["#{@package.downcase}_release_date"]
Copy link
Member

Choose a reason for hiding this comment

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

何回もパースしたくないんですが、どうにかなりませんか?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fix: 830f70e

release_task.rb Outdated
@@ -28,14 +34,44 @@ def define

private

def jekyll_config
YAML.safe_load_file("_config.yml", permitted_classes: [Date])
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
YAML.safe_load_file("_config.yml", permitted_classes: [Date])
YAML.safe_load_file(File.join(@jekyll_path, "_config.yml"), permitted_classes: [Date])

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fix: e86ac25

release_task.rb Outdated
end

def detect_version
jekyll_config["#{@package.downcase}_version"]
Copy link
Member

Choose a reason for hiding this comment

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

なんども@package.downcaseしているのが気になるんですが、initializepackageじゃなくてproductあるいはproduct_labelとして受け取って@product_id = product.downcaseして論理的にどういう値として扱っているかを名前でわかるようにするとか、なんとかなりませんか?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fix: 26072b2 どうするか悩んだのですが、initialize時に受け取った変数を変更せずに持っていたかったので、#product_idメソッドで対応する形にしてみました。(ブログのポストの中で、Groongaで利用するため)

Copy link
Member

Choose a reason for hiding this comment

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

@versionとかは事前に計算しているので合わせませんか?

@product@product_idがあってもおかしくないと思います。

Copy link
Member

Choose a reason for hiding this comment

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

@versionとかをメソッドにする方に寄せるのでもいいと思います。

とにかく揃っていて欲しいです。

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fix: 624c7e5事前に計算する形に揃えました 🙏🏾

@otegami otegami force-pushed the release-generate-release-posts branch from 04be004 to 624c7e5 Compare December 4, 2024 08:02
@kou kou changed the title release blog: generate release post release blog: generate release post without content Dec 4, 2024
@kou kou merged commit da5c96d into groonga:gh-pages Dec 4, 2024
1 check passed
@otegami otegami deleted the release-generate-release-posts branch December 4, 2024 08:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants