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

Add the isPermaLink attribute to guid in RSS #107

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

yardenshoham
Copy link

@yardenshoham yardenshoham commented Jan 10, 2024

What type of PR is this?

  • Refactor
  • Feature
  • Bug Fix
  • Optimization
  • Documentation Update
  • Go Version Update
  • Dependency Update

Description

Adds the optional attribute from the guid RSS spec: https://www.rssboard.org/rss-specification#ltguidgtSubelementOfLtitemgt

This is a breaking change to the RssItem struct as Guid is now a struct, not a string.

Related Tickets & Documents

Added/updated tests?

  • Yes
  • No, and this is why: please replace this line with details on why tests
    have not been included
  • I need help with writing tests

Run verifications and test

  • make verify is passing
  • make test is passing

Adds the optional attribute from the `guid` RSS spec: https://www.rssboard.org/rss-specification#ltguidgtSubelementOfLtitemgt

This is a breaking change to the `RssItem` struct as `Guid` is now a struct, not a string.

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
lunny pushed a commit to go-gitea/gitea that referenced this pull request Jan 20, 2024
…28860)

Our `guid` is not a valid URL so according to the RSS spec the
`isPermaLink` attribute needs to be set to `false`.

Example:
```diff
<item>
  <title>yardenshoham opened issue &lt;a href=&#34;https://3000-yardenshoham-gitea-jqlxjixsez9.ws-us107.gitpod.io/yardenshoham/test/issues/2&#34;&gt;yardenshoham/test#2&lt;/a&gt;</title>
  <link>https://3000-yardenshoham-gitea-jqlxjixsez9.ws-us107.gitpod.io/yardenshoham/test/issues/2</link>
  <description>2#hey</description>
  <content:encoded><![CDATA[2#hey]]></content:encoded>
  <author>yardenshoham</author>
- <guid>355: https://3000-yardenshoham-gitea-jqlxjixsez9.ws-us107.gitpod.io/yardenshoham/test/issues/2</guid>
+ <guid isPermaLink="false">355: https://3000-yardenshoham-gitea-jqlxjixsez9.ws-us107.gitpod.io/yardenshoham/test/issues/2</guid>
  <pubDate>Tue, 16 Jan 2024 18:54:36 +0000</pubDate>
</item>
```

References:
-
https://www.rssboard.org/rss-specification#ltguidgtSubelementOfLtitemgt
- Fixes #28734
- gorilla/feeds#78
- #21550
- gorilla/feeds#107

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
yardenshoham added a commit to yardenshoham/gitea that referenced this pull request Jan 20, 2024
…o-gitea#28860)

Our `guid` is not a valid URL so according to the RSS spec the
`isPermaLink` attribute needs to be set to `false`.

Example:
```diff
<item>
  <title>yardenshoham opened issue &lt;a href=&#34;https://3000-yardenshoham-gitea-jqlxjixsez9.ws-us107.gitpod.io/yardenshoham/test/issues/2&#34;&gt;yardenshoham/test#2&lt;/a&gt;</title>
  <link>https://3000-yardenshoham-gitea-jqlxjixsez9.ws-us107.gitpod.io/yardenshoham/test/issues/2</link>
  <description>2#hey</description>
  <content:encoded><![CDATA[2#hey]]></content:encoded>
  <author>yardenshoham</author>
- <guid>355: https://3000-yardenshoham-gitea-jqlxjixsez9.ws-us107.gitpod.io/yardenshoham/test/issues/2</guid>
+ <guid isPermaLink="false">355: https://3000-yardenshoham-gitea-jqlxjixsez9.ws-us107.gitpod.io/yardenshoham/test/issues/2</guid>
  <pubDate>Tue, 16 Jan 2024 18:54:36 +0000</pubDate>
</item>
```

References:
-
https://www.rssboard.org/rss-specification#ltguidgtSubelementOfLtitemgt
- Fixes go-gitea#28734
- gorilla/feeds#78
- go-gitea#21550
- gorilla/feeds#107

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
@AlexVulaj
Copy link
Member

Is there any way we could add this as a new property instead? I'd prefer to not introduce a breaking change if we can avoid it here.

@yardenshoham
Copy link
Author

I don't see how that would be possible, RssItem is serialized directly to XML so it would have to be a bigger change

@jaitaiwan
Copy link

From what I read - the ask for this change is because some of the feeds generated by other providers doesn't meet the RSS 2.0 spec. Is there another spec that this library explicitly supports which this feature would fit under?

I'm less concerned about a breaking change and more concerned about if we're not meeting a spec. I think there's a case for if this is in one of the spec we explicitly support but we're not supporting it, that is a strong argument for a breaking change imho.

henrygoodman pushed a commit to henrygoodman/gitea that referenced this pull request Jan 31, 2024
…o-gitea#28860)

Our `guid` is not a valid URL so according to the RSS spec the
`isPermaLink` attribute needs to be set to `false`.

Example:
```diff
<item>
  <title>yardenshoham opened issue &lt;a href=&go-gitea#34;https://3000-yardenshoham-gitea-jqlxjixsez9.ws-us107.gitpod.io/yardenshoham/test/issues/2&#34;&gt;yardenshoham/test#2&lt;/a&gt;</title>
  <link>https://3000-yardenshoham-gitea-jqlxjixsez9.ws-us107.gitpod.io/yardenshoham/test/issues/2</link>
  <description>2#hey</description>
  <content:encoded><![CDATA[2#hey]]></content:encoded>
  <author>yardenshoham</author>
- <guid>355: https://3000-yardenshoham-gitea-jqlxjixsez9.ws-us107.gitpod.io/yardenshoham/test/issues/2</guid>
+ <guid isPermaLink="false">355: https://3000-yardenshoham-gitea-jqlxjixsez9.ws-us107.gitpod.io/yardenshoham/test/issues/2</guid>
  <pubDate>Tue, 16 Jan 2024 18:54:36 +0000</pubDate>
</item>
```

References:
-
https://www.rssboard.org/rss-specification#ltguidgtSubelementOfLtitemgt
- Fixes go-gitea#28734
- gorilla/feeds#78
- go-gitea#21550
- gorilla/feeds#107

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
silverwind pushed a commit to silverwind/gitea that referenced this pull request Feb 20, 2024
…o-gitea#28860)

Our `guid` is not a valid URL so according to the RSS spec the
`isPermaLink` attribute needs to be set to `false`.

Example:
```diff
<item>
  <title>yardenshoham opened issue &lt;a href=&go-gitea#34;https://3000-yardenshoham-gitea-jqlxjixsez9.ws-us107.gitpod.io/yardenshoham/test/issues/2&#34;&gt;yardenshoham/test#2&lt;/a&gt;</title>
  <link>https://3000-yardenshoham-gitea-jqlxjixsez9.ws-us107.gitpod.io/yardenshoham/test/issues/2</link>
  <description>2#hey</description>
  <content:encoded><![CDATA[2#hey]]></content:encoded>
  <author>yardenshoham</author>
- <guid>355: https://3000-yardenshoham-gitea-jqlxjixsez9.ws-us107.gitpod.io/yardenshoham/test/issues/2</guid>
+ <guid isPermaLink="false">355: https://3000-yardenshoham-gitea-jqlxjixsez9.ws-us107.gitpod.io/yardenshoham/test/issues/2</guid>
  <pubDate>Tue, 16 Jan 2024 18:54:36 +0000</pubDate>
</item>
```

References:
-
https://www.rssboard.org/rss-specification#ltguidgtSubelementOfLtitemgt
- Fixes go-gitea#28734
- gorilla/feeds#78
- go-gitea#21550
- gorilla/feeds#107

Signed-off-by: Yarden Shoham <git@yardenshoham.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[FEATURE] Ability to set isPermaLink="false" for guid [feature] isPermaLink="false" for guid field
3 participants