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

Check for Deprecated on method page #55

Merged
merged 1 commit into from
Oct 2, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
build/
.bundle
vendor/
.idea
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ Changelog
Some notable infrastructure contributions below. See [commits](commits/master) for Slack API updates.

* Your contribution here.
* Consider `Deprecated:` label in API method summary - [@kstole](https://github.com/kstole)
* Updated crawlers to use new API documentation DOM - [@chrisbloom7](https://github.com/chrisbloom7).
* Added undocumented methods - [@manuelmeurer](https://github.com/manuelmeurer).
* Modified method scraper to look for <a> tags within <table> - [@alexagranov](https://github.com/alexagranov).
Expand Down
82 changes: 0 additions & 82 deletions methods/rtm/rtm.start.json

This file was deleted.

2 changes: 2 additions & 0 deletions tasks/lib/slack_api/methods_spider.rb
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,8 @@ def process_list(page, _default_data = {})
def process_method(page, default_data = {})
method_page = ensure!(page, '.apiMethodPage', default_data[:method_name])
desc = method_page.search('.apiReference__mainDescription').text.gsub("’", "'")
return if desc.downcase.start_with? 'deprecated:'
Copy link
Collaborator

Choose a reason for hiding this comment

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

Shouldn't this change the value of deprecated: below instead?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

It looks like that used to be the behavior but was changed in #48 to hardcode 'deprecated' => false and just remove any deprecated methods, so this is an extra check for when isDeprecated isn't accurate

next if method['isDeprecated']


args, fields = parse_args(method_page, default_data)
errors = parse_errors(method_page, default_data)
response = parse_response(method_page, default_data)
Expand Down