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

Fix(accumulate): remove extra ) in canonical-data.json #1921

Merged
merged 1 commit into from
Jan 19, 2022

Conversation

ynfle
Copy link
Contributor

@ynfle ynfle commented Jan 17, 2022

Fixes: #1920

@ynfle
Copy link
Contributor Author

ynfle commented Jan 17, 2022

I have to read the docs before I mutate the tests 🤦‍♂️

@ynfle ynfle marked this pull request as draft January 17, 2022 23:39
@SaschaMann
Copy link
Contributor

The exercise is deprecated: #1918. Not sure if that means that this shouldn't be merged, though.

@ynfle
Copy link
Contributor Author

ynfle commented Jan 17, 2022

The exercise is deprecated: #1918. Not sure if that means that this shouldn't be merged, though.

Is there an easy way to see if any tracks still have it without having to download every tracks' git repo?

@ynfle ynfle marked this pull request as ready for review January 17, 2022 23:47
@ynfle
Copy link
Contributor Author

ynfle commented Jan 18, 2022

@SaschaMann after a quick url test the following languages have accumulate available as an exercise:

  • python
  • javascript
  • sharp
  • haskell
  • clojure
  • sharp
  • ruby
  • java
  • elixir
  • elm
  • erlang
  • go
  • julia
  • kotlin
  • php
  • perl5
  • rust
  • swift
  • scala
  • typescript
  • wren

Copy link
Member

@petertseng petertseng left a comment

Choose a reason for hiding this comment

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

I think we would merge fixes to existing tests. I think we would advise against adding new tests.

@ynfle
Copy link
Contributor Author

ynfle commented Jan 18, 2022

For a complete list and analysis of how many added "status": "deprecated", the following bash script with jq:

for i in `curl -s https://exercism.org/api/v2/tracks | jq -r '.tracks[].slug'`
do
	echo "$i": `curl -s https://raw.githubusercontent.com/exercism/"$i"/main/config.json | jq '.exercises.practice[] | select(.slug=="accumulate").status'`
done | grep 'null\|deprecated'

yielded

csharp: null
clojure: null
coffeescript: null
elixir: "deprecated"
elm: null
erlang: null
fsharp: null
go: "deprecated"
groovy: null
haskell: null
java: "deprecated"
javascript: "deprecated"
julia: "deprecated"
kotlin: "deprecated"
lfe: "deprecated"
lua: "deprecated"
perl5: null
php: null
purescript: null
python: "deprecated"
racket: "deprecated"
raku: null
reasonml: null
ruby: null
rust: null
scala: null
scheme: null
sml: null
swift: null
tcl: null
typescript: null
vbnet: null
wren: null

where null means implemented but no status key & "deprecated" means implemented and status key.

Results:

Deprecated Count
true 10
false 23
Total 33

EDIT: Made bash script runnable

@junedev
Copy link
Member

junedev commented Jan 18, 2022

@ynfle Just FYI The exercise was officially deprecated 5 days ago and there was no notification to tracks yet so your analysis does not give the picture of how many would deprecate if they knew about it.

@ynfle
Copy link
Contributor Author

ynfle commented Jan 18, 2022

@ynfle Just FYI The exercise was officially deprecated 5 days ago and there was no notification to tracks yet so your analysis does not give the picture of how many would deprecate if they knew about it.

True. I don't think any amount of bash and jq could help with that yet...

Copy link
Member

@ee7 ee7 left a comment

Choose a reason for hiding this comment

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

I think we would merge fixes to existing tests. I think we would advise against adding new tests.

I agree. I think the original commit b3e2f50 has the better approach here.

The value of this accumulator key before this PR is just wrong; I have to imagine that every track that implements this test case has implemented it identically to how they'd implement the typo-free version. So I'd argue that we should treat this like we treat fixing a typo in a description - just mutate it when it doesn't change the "meaning". See #1687 for the discussion that led to description becoming mutable in some circumstances, and #1709 for discussion of error becoming mutable.

Adding a new test case means that every implementing track has a noisy update to the corresponding tests.toml file without changing their user-facing tests file. We might think that's less painful given that this exercise is deprecated, and so tracks might feel less need to update. But configlet sync currently exits non-zero when there is only an update to a deprecated exercise (regardless of whether it's deprecated only in prob-specs, only on the track, or both). That is, a track is currently incentivized to update a deprecated exercise if they want an exit status of 0 from a track-wide configlet sync.

If we just mutate then also note that:

@SaschaMann
Copy link
Contributor

just mutate it when it doesn't change the "meaning".

While in this case it may be quite clear, there are a lot of different ideas of what changes the meaning and what is only a bug fix which leads to pointless and endless discussions. The requirement that test cases are immutable even if they contain a bug is there for a reason.

@ynfle
Copy link
Contributor Author

ynfle commented Jan 19, 2022

Either way, I think everyone can agree its a typo here. @iHiD thoughts? (I feel bad pinging you, I'm sure there are lots of things going on)

Copy link
Member

@ErikSchierboom ErikSchierboom left a comment

Choose a reason for hiding this comment

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

First off, the fact that we've deprecated an exercise does not mean that tracks must deprecate the exercise, only that we recommend they do so. There can be very valid reasons why a track would want to keep a deprecated exercise. I do admit that it should be the exception though.

Taking that into account (that tracks might keep the exercise active), whether or not we should merge fixes then becomes easy to answer: we should.

As to the discussion on whether a we need a new test case, I'm of the opinion that we do. Yes, it is rather clearly a simple typo, but tracks could have their generator depend on that typo, which means that fixing it would break those generators. It is precisely to avoid these scenarios that we introduced the whole immutability property. I really don't want to have a situation where we'll have to decide collectively whether or not something is a bug fix.

@SaschaMann SaschaMann merged commit 52ba7cc into exercism:main Jan 19, 2022
@ynfle ynfle deleted the fix-accumulate-typo branch March 1, 2022 13:14
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.

Typo in accumulate
6 participants